Trains derail all the time. It’s dog bites man, not man bites dog.
The exception here in Barcelona is Line 1 which is a wider gauge than all the other lines, for historical reasons though it doesn't share any tracks (but lays right beside the train ones at some stations)
PS I didn't know the NYC metro was so big compared to the rest. Wow.
In many industries, commercial competitors discover when regulators have shirked their duties. In the rail industry, with no effective competition, many theoretical regulations are not actually enforced. This problem has gotten worse over time.
Your concerns about Amtrak may be valid, but they are orthogonal to the topic at hand.