Hunedoara is compact enough that the main visit — arriving at the train or bus station, walking to the castle, exploring it, eating nearby, and returning — can be done entirely on foot in half a day.
On foot: The train station is about 1.5 km from the castle, a straightforward walk through the town centre. The bus stop for services from Deva is closer to the castle entrance. The castle, the Orthodox church, and the handful of restaurants and cafes are all within easy walking distance of each other.
Taxis: Available from the train station and around the town centre. Useful if you are arriving with luggage or want to move between the bus stop and the castle quickly. Fares within the town are low by Western standards — the train station to the castle should be under 20 lei.
Rideshare: Bolt operates in Hunedoara, though supply of drivers is limited. It is a reasonable option, particularly for getting back to the station at the end of a visit.
There is no need for a rental car if you are visiting just Hunedoara, but a car opens up the day-trip possibilities to Retezat National Park and the Dacian sites to the south, which have limited public transport access.