I know there are also buses between these cities, but I'm trying to find timetables for trains.
A daytime train leaves Belgrade every day at 11:03 arriving Zagreb 18:11 & Ljubljana 20:56. It's a leisurely trip across the former Yugoslavia on a route once used by the Simplon Orient Express. Bring your own provisions and perhaps some beer or wine...
But what about the other direction, Zagreb to Belgrade? With quick look, I could not find that info on Seat 61, and the Croatian train company site doesn't show anything for Belgrade. Info from some official resource as well as recent first-hand experiences are both welcome.