The cause was an overheated wheel bearing melting and dislodging the axle, causing a derailment.
The overheating was detected, and ignored. The quote is, as I recall, "The next sensor will detect it if it's a problem."
Could the electric brakes have helped? Not sure in this specific case. In other cases? Probably. Air brakes are remarkably cool technology (how the valves work still boggles me from time to time) but they are still, in the end, civil war era technology that's probably due for an upgrade.