There are special trains with measurement equipment on board, but yes, it sounds to me like every train should be equipped with some basic sensors for anomaly detection.
Germany: https://de.wikipedia.org/wiki/RAILab
Japan: https://en.wikipedia.org/wiki/Doctor_Yellow
France: https://en.wikipedia.org/wiki/SNCF_TGV_Iris_320
China: https://en.wikipedia.org/wiki/China_railways_CIT_trains
> Line inspection is carried out at full speed, up to 270 km/h or 168 mph on the Tōkaidō Shinkansen and 285 km/h or 177 mph on the Sanyō Shinkansen