When it comes to public transportation, they rarely pull a profit on their own. What they do is drive the economy in the places they go, make a city more accessible to everyone (further driving the economy), and cut costs for the city in other places. They’re a loss leader to save money and improve quality of life in a multitude of other areas by huge margins.