No trains I’m afraid and not likely to be next year. You’ll need to research busses.
You can do part of it by train, see:
https://www.seat61.com/trains-and-routes/belgrade-to-sofia-by-train.htm
There are probably also direct buses.
In fact getting TO Bgr will put you for the same prob: as ALL INternat trains to there are no more (except from the black mountains=Cerna Gora). Again seat61.com will show ALT routings, but be aware that these cumbersome part train-walk-bus/taxi-other train ways make you loose many hrs and may in the end even cost more as a direct bus ticket. This is only for diehard railfans or those who are so much anti-bus that any expense is warranted for that. Sensible people take it as it is.
BTW-Bgr does not offer that much to see, my advice would be as it is now: skip it. IF Sofia is your destination-take the routing via HU/B.pest-Romania, also detailed again in seat61
Hi, thanks for the help! Sofia is already my destination, it's a 2 month trip and I will be reaching Sofia from Varna on the coast after visiting Bucharest.
Belgrade seemed like a good point throughout my European journey. If Belgrade doesn't offer much, where should I go?
(I should note, I want to go to Sarajevo and Mostar in Bosnia and also go to Croatia)