Text this: Optimal control strategy for trains in emergency self-propelled running conditions