Mary, this is the website I have found reliable in the past - the Slovenian rail website:
https://potniski.sz.si/en/zagreb/
Keep in mind that due to construction, some trains may be delayed or not running in certain periods. This site does have a note about buses replacing trains until August 4 but no mention of construction after that:
https://potniski.sz.si/en/zagreb/
It shows three trains to Ljubljana - at 7:05, 12:50, and 19:38. (The 12:50 if running does not stop at Kranj.)
Your best bet it to confirm the schedule at the train station (when you go to buy your tickets) once you get to Zagreb.
If it turns out there are no trains running due to construction or something? Then take a bus instead. FlixBus seems to have at least a dozen buses a day between cities. I have not used the bus station in Zagreb - but it's not far from the train station. There are several direct buses a day between Zagreb and Ljubljana, and some people seem to prefer them even when they could take the train. (I prefer trains and avoid buses except as a last resort, but some people don't really care either way.)
A third option would be to book a GoOpti shuttle (a van basically) to Slovenia. It would certainly cost more than either a bus or a train, but at least you'd know there is some other option to get there. I used GoOpti last fall to get from Ljubljana to Venice airport and it worked fine. It's a Slovenian company that provides transport to various places on demand.