One can also say that about government military force and police forces and flat roads, that because they are desirable does not mean that governments ought to provide them.
Military forces, police forces, judicial systems, correctional systems, flat roads, and air-traffic-control systems are all money-losers that are nevertheless funded by governments, with all political parties and factions supporting their financing except for anarchists and hard-line libertarians. One can dispense with military and police forces by becoming a vigilante or hiring guards, but nobody seems to want to do that. One might even argue that if soldiers' and cops' services have value, then people will hire them as guards, and that we don't need governments to run military and police forces.
So one ought to ask what value something provides if it is not a moneymaker. The value that these items provide is considered a good justification. There is also the problem of enforcing paid access for roads. Does anyone want a toll booth on every block? Technology may provide a solution in the form of a transponder that one would put on one's vehicle, something like a RFID chip, but that has problems of its own.
For intercity passenger trains, one can justify them the way that one justifies urban-transit systems, that they are cheaper than building lots of roads and airports. Maybe not airports for urban systems, but certainly for intercity ones. On the subject of airports, I must ask which ones have been built by the airlines that serve them.
That argument can work for short-distance corridor trains like the Northeast Corridor ones, but not for long-distance trains.
For those, one can use the case of national monuments and national parks, and also state and city ones. That would work for trains that go by scenic areas, but that does not work for many long-distance trains.
The final argument seems to be the pork-barrel value of long-distance trains. Pork-barrel value is what caused the Interstate highways to be built inside cities, instead of being exclusively intercity. Pork barrel is a side effect of a region-based political system, where most national politicians serve single states or single districts in states.
Pork-barrel value has kept going Amtrak's rather sparse system of long-distance trains. These trains currently go to 46 of the 48 contiguous states.
Although I am hopelessly statist by libertarian standards, I don't see much reason in keeping long-distance trains going, at least more than the current token level of them. I prefer development of short-distance corridor trains, though some populated strip like the Atlantic coast can enable their combination to grow to long-distance length.