Looks like these anchor points on the train were part of train design for this very function, just in case of derailment.