The invention has for object an automatic radio-electro-mechanical system for the detection of the derailment of one or more railway wagons towed by a locomotive, with an alarm signal in the cabin. The system involves the use of 2 electromechanical sensors (load cells) for detecting the tensile stress to the hook (one for each direction of travel of the locomotive), an accelerometer, a GPS module and a module that uses common GSM-R mobile telephone technology specific for railways (Global System for Mobile Communications - Railways). The electro-mechanical sensors are constituted by load cells of the type to bending, tension, or cut, equipped with strain gauges installed preferably according to the electrical diagram of a double full Wheatstone bridge in order to detect the stress at the locomotive traction hook. In the preferred embodiment, the accelerometer detects at least the acceleration on three axes. In the preferred embodiment, the GPS module detects the data according to the NMEA 0183 standard.