>
Mass transportation has always lost moneyMost passenger rail in Japan is private, and profitable, including both capital and operating expenses.
In the years leading up to WWII, and during it, the Japanese government nationalized many rail lines (although many stayed private as well) to form JNR, and JNR proved to be too inefficient, and built up a lot of debt. That then of course lead to the privatization of JNR in the 1980s (which included transferring JNR's debt to the new private JR companies), which was highly successful.
> In Japan, they over-invested in trains and it produced a huge drag on the economy
Japan has invested a lot in rail, but it certainly isn't a "drag on the economy". Indeed, it's arguably a boon to the economy as it's a much more efficient transit system than private vehicles on roads, and given the business model of Japanese railroads (which builds retail and housing around railroad nodes, and builds railroads to support new retail and housing), directly contributes to much more efficient urban organization.
The rail lines in Japan that lose money are rural ones in sparsely populated areas. However these account for a very small proportion of rail usage.