I happen to know that the Ford EEC-IV engine control module of the 1980s was designed for a 30-year lifespan. Which it delivered; many 1980s vehicles are still running with it. But newer electronics won't last that long. Line sizes are too small, and minor effects such as electromigration cause wear-out.
BART is a perfect example of this. BART went with non-standard rail gauge and very long trains and stations. This makes it difficult and expensive for BART to buy new cars and fix problems.
Here in Japan, the metro system is great. Trains are always on time, they don't break down (because they actually do maintenance!), there's constantly new construction too. On top of this, the train systems are all privately owned: different companies own the different lines. Even so, they all use the same payment method: a simple contactless debit card (suica or pasmo) that works at every station across the country (as well as in vending machines, restaurants, taxis, and countless other places). It's really amazing just how horrible metro systems in the US are compared to this; it's like going to another planet.
However, OP's main example is the NYC metro system, which is decidedly not cheap. A similar problem occurred in SF: BART cars are being replaced with multi-$M cars full of electronics & are now having numerous breakdowns.
BART drivers used to reboot the old trains by flipping 4 sets of switches. Now the reset process has hundreds of steps, so most drivers just take the car offline & call for a mechanic. And there's far more failure modes to the new cars as well. Thus: the new cars are more expensive, more fragile, & harder to maintain. BART scored a perfect 'Reverse Better-Faster-Cheaper'.
How did this happen? Politics & payola. The new proposed cars were barely shown to the public, & only for UX/design feedback.
The tie-in's to capitalism that OP describes are apt too: very big companies tendered their bids for these new cars. Maintainability wasn't a key design feature. It's not just our economic system (capitalism) that isn't interested in maintainability- our political system isn't either. Decision makers who won't be in power to see the need for their shiny new acquisitions to be maintained, never seen to care that they will.