I actually have a dissenting opinion to Arnold's, which I hate to do because I've always secretely hoped Arnold would adopt my husband and I and take us along on all of his travels (seriously, Arnold, you have been to some amazing places).
But last year we took the train from Mostar to Sarajevo and took the bus back, and preferred the bus. My memory doesn't recall a big price disparity between the two (and I'm cheap, so if the bus was a lot more we wouldn't have done it), and I recall the travel time was about the same. The train seemed to go through a lot of tunnels and didn't seem to be nearly as scenic (they both follow roughly the same route along the river), and the bus seemed to give a closer view of the countryside, homes (both intact and bombed-out) and random UN trailers that had been abandoned after the war. Further, and this might be one reason why the bus seems a better option to me, smoking was allowed on the train and our small compartment for 6 people got even smaller when someone would light up. Without opening a window. I'm certainly not an anti-smoking nazi, but the air got to be a bit thick inside, so getting off the train and sucking in deep breaths of train engine diesel was a welcome relief.
Either way, though, gets you from A to B so you really can't go wrong. Hope you have a great trip!