In general, this is actually done: there are defect detectors that are installed along tracks that monitor for several conditions as trains pass over/through them. Once the train has passed, a voice radio message is sent to the train crew.
I'm astonished that they treat those alarms like I treated the check-engine light as a poor kid who reasoned that the car seems to still be running fine.
Here's an example of one working: https://www.youtube.com/watch?v=R7BGg82uQ1U
I'm not sure whether similar equipment was a factor in the East Palestine incident.