There are no international trains to and from Greece at the moment. The easiest way which includes a night train is as follows :
- Thessaloniki - Sofia bus (Flixbus but there may be other companies too)
- night in Sofia
- Sofia - Bucharest 07:05 - 17:08 (you may or may not need to change at Gorna Orjahovica but the connection is guaranteed and timings remain the same). 1.25€ seat reservation (unlimited availability at Sofia train station)
- Bucharest - Budapest 2 night trains : either 18:25 - 08:50 or 21:46 - 12:50
For those night trains here are your options to book it :
- Bucharest railway station
- Interrail reservation service (but 10€ extra fee as seat reservations need to be mailed to you)
- maybe calling DB and having the paper reservations mailed to you (still cheaper than via interrail.eu)
- some option I’ve missed
Or you spend a night in Bucharest and then take the 13:50 - 05:20 night train which is available online through tickets.oebb.at (no booking fee)
Other route : ferry to Italy from Patras or Igoumenitsa and then ferry from Italy to Split + night train to Budapest (doesn’t run daily though)