I would suggest booking Zagreb-Dubrovnik and travelling from Dubrovnik to Mostar (and Medugorje if desired) and on to Sarajevo by bus. It's pretty well served.
Alternatively, if you can drop the car at Ploce (doubling back from Dubrovnik), there's a daily train from there on to Mostar and Sarajevo I took this some time ago, and it's a great, if slightly obscure, little journey. However, depending on the time of year, the northbound journey could be in the dark.