the Bratislava-Budapest train I got two weeks ago continued to Belgrade. Took another 7 hours for what is quite a short distance and seemed to stop every 20kms or so
Starting with Prague, the national technical museum is interesting to visit with a gd collection of steam engines, away newr Devicka S bahn is the public transport museum, on the same s bahn line, s5 i think is the national railway museum at luzna u rajovnika sometimes you have to change at kladno. The narrow gauge at jindrichuv hradec is a nice day trip frm prague.
The rest of the Czech Republic and Slovakia is great for scenic lines both main and branch ones. Have you been on the childrens railway in Budapest, a must see.
I'd heard that the Sofia-Istanbul train was a bus frm Kapikule due to the new Bhorous tunnel.