What do you mean? Serbia is open to all travellers, I only think you'll need a PCR test.
There are no trains from Budapest to Belgrade. Zagreb to Belgrade currently has one direct train per day running. Trains between Montenegro and Serbia are back again, with the night train as well as the daytime train.
You can make a mix of train+bus from Belgrade to Budapest. Train goes until Serbian border city of Subotica (which is also worth half a day stay over) and then take a bus from there to Belgrade. @jonworth on twitter did this trip recently. You may check it out there.
Not finding what you're looking for?
Don't be shy and let us know about your challenge.