Depends on the traffic and the train -- during rush hour, a Caltrain express train from San Francisco to San Jose is almost always faster than driving. It can take 90 - 120 minutes to drive during commute hours (at 4:30pm, Google says 90 minutes), versus 65 minutes by train.
I don't disagree that a train is better in many situations. I'm more curious about situations where a city is prepared to make a 1B+ capital expenditure. For example boring a tunnel for a train vs. a dedicated bus lane on the highway + exit.
Is that dedicated lane cheaper? In many cities that are facing a traffic crunch, they've already made all of the "easy" road improvements -- for example, 101 in the SF Bay Area is pretty much all built in to the center median, so adding new lanes means adding outside lanes (which requires rebuilding every bridge and intersection).
It'd be cheaper, of course, to take an existing lane and convert it to a bus-only lane, but that's politically infeasible.