There's a lot of externalities around transit that aren't directly priced into costs vs ticket revenue.
If France decides "We want high speed national rail connectivity between cities", I'd look at it more of an entitlement / service than a profitable enterprise.
Nobody expects national healthcare services to be profitable.
(Also, both France and Germany's relatively recent experience with their national rail networks being the reason their countries are still independent sovereign states)
Germany and France were on the verge of collapse or being conquered but government trains saved them? Do tell.
But also, they're maybe not very sovereign when a foreign body drafts, ratifies, and enforces their laws
Public libraries don't run as profit centers, and yet everyone generally agrees they provide a social benefit and are worth funding.
Ref: world wars, part I and II.
So you're saying that if the Nazis didn't have subsidized train rides for tourists they would not have been able to collapse the Soviet Union in 1991 and regain East Germany? Interesting. Very interesting, sir.