Remember, public transportation runs the way it does because it's a public good - it is pretty much by definition something that the market is bad at providing, but which people need anyhow. If CalTrain had to survive off of ticket revenue alone, it would cost more than twice as much to ride, and would thus exclude some riders, harming revenues further. On top of this, CalTrain relieves traffic - it provides a significant positive externality instead of capturing value. Government subsidies to public transportation agencies address this externality.
CalTrain is dying because of the tragedy of the commons: a great many people can benefit from it (traffic, air quality) without paying for it, and will resist any attempt to require that they contribute to it. This is the situation that many, many public agencies are in.