I think these kinds of accidents are largely mitigated by rail defect monitoring. I know rails in the US are equipped with defect detectors for passing trains; I'm surprised that a similar system doesn't exist for the rails themselves. Or more likely, one does exist and the outcome of this tragedy will be a lesson about operational failures.
the more you build the more maintenance costs rise.
That's simply really, really rare bad luck.
Practically anything you can think of is going to be a more effective use of safety resources than trying to contain a derailing high-speed train.
Also the issues other comments described, including that any fault in the barrier means a new safety hazard
But that requires the trains mostly always being on schedule.