Balkan trains...you are in for an adventure! The fact is that there aren't many. Some that existed 15 years ago may no longer be running. Such trains as exist are often very, very slow--about the same speed as buses. Figure 30 mph, roughly. And the buses are in some respects more comfortable (more likely to be air-conditioned, I think). Border-crossing buses tend to run very infrequently, so it's always a good idea to buy those tickets as soon as you're sure of your travel date. (I doubt that you'd need to do it before landing in Greece.)
I've never tried to link Greece and Bulgaria but did travel through Bulgaria and Romania via bus and train in 2015.
My starting point for continental rail schedules is the Deutsche Bahn website. You won't find fares there, but they will be low enough not to be an issue, I think. If DB doesn't know about a train (and this is the case for Thessaloniki-Kardzhali), I head to Rome2Rio to see what options it presents. Rome2Rio can be wildly inaccurate about travel times and fares but is often useful in pointing you to the best combination of transportation to get you where you want to go. Often that will be a train plus a short bus ride. But not in this case. Rome2Rio is suggesting that you spend all day on buses. One of the routes involves a change in Zlatograd (as well as in Xanthi), which is logical. The other is an insane-looking routing by way of Sofia. But as I said, those schedules are often wildly off-base, so you need to do more research.
Drill down on Rome2Rio to find the names of the bus companies you'll need to use. Usually there's a link that will help you find a schedule. If not, once you know the starting and ending point of each bus link, you can use Google: Bus Zlatograd to Kardzhali. You may not even need to use the bus company's name. See what turns up.
Warning: For buses in that part of Europe, the internet schedules may not always be complete and up to date. My policy was to confirm everything in person at the bus station as soon as I arrived in town. If there's a language issue, the tourist office (if the town is large enough to have one) will help you out. I noticed that even in the more-developed Croatia, when I asked a tourist office about the schedule for a bus departing from a different city, the staffer did not go online to look for the information. He or she picked up a phone and called.
Once you get to Plovdiv (very nice city), you can connect by rail to Sofia and the old capital of Veliko Trnovo (also well worth a visit). There's also train service from Sofia to VT.
You can travel by train from either Sofia or Veliko Trnovo to Bucharest, crossing the border at Ruse (said to be an attractive city; I didn't stop there). By train, Bucharest seems unavoidable and it is not out of the way if your next stop is Brasov or Sighisoara. I think there may be more buses than trains running between Ruse and Bucharest, so keep that in mind as an option.
Sighisoara does have rail service from Brasov, but I'd advise always checking for buses, too, because they may be faster.
From Sighisoara on to Budapest is quite a slog. You'll be changing trains in either Sibiu or Cluj-Napoca. They are both very pretty cities and worth a stop, which you'll need to do somewhere since the travel time is 14 - 17 hours.
You didn't mention the length of your trip. You really need time in the Balkans if you want to cover much ground. If your time is short, you might consider planning separate trips to Bulgaria and Romania. There's lots to see in both countries. There are flights from Thessaloniki to Bucharest (check skyscanner). I spent 27 days in Romania and Bulgaria and felt very rushed.