Fast estimation of the derailment risk of a braking train in curves and turnouts