Try to stay calm, especially if you have passengers with you. If you can’t restart your engine before the warning bells ring, leave the vehicle and get yourself and any passengers well clear of the crossing.
You may also be interested in these theory test questions