Looking specifically at the NYC subway, they are both over-spending and under-spending at the same time. In a nice example of the Boots Theory[0], they are spending money by the boatloads to keep the dating infrastructure working. A lot of it dates back to the 1930s, and it is impossible to get replacement parts. A newer system would be far easier and cheaper to maintain - but in the short term replacing it would be an enormous cost.
This is made even worse by it running 24/7. Without a maintenance window, doing proper preventative maintenance is pretty much impossible.