To add to Laura's great advice, you do have enough time to have a short visit of Ljubljana, but you would be cutting it close if you wanted to include Bled as well. That said, if you really want to see both Lake Bled and Ljubljana and won't be coming back to this part of the world, what you can do is the following:
get off the train at Lesce Bled (a 10-minute drive from the lake) at 13:51 and take a taxi to the bus station in Bled, which is by the waterfront and where you can leave your luggage
visit the lake waterfront for an hour
pick up your luggage and take a taxi back to the train station at around 15:15, catch the 15:45 train to Ljubljana
arrive in Ljubljana at 16:52
visit the city centre
take the 20:45 Deutsche Bahn bus, arriving in Zagreb at 23:11
I don't want to recommend doing this as there are plenty of things that can go wrong and you won't get to see the castle or go to the island, but if you really want to visit both towns, this will give you just enough time to take a stroll along the waterfront in Bled. As for Ljubljana, three hours or so is enough time for a walk around the riverfront and the old town before returning to the bus/train station.