> they just had shitty railroad
The terrain is just hard railroad had do huge detour on this section
Look at map: https://mapy.com/en/turisticka?x=15.0703419&y=46.7076432&z=1...
Passes in those mountains are only ~1200m above valley level (~1650 abs). Yeah, perfectly ok to run railroad there.
Your autobahn climbs 600m on this section (to 1050m absolute) - it's way to high for railway to be effective.