Idioms of rail in English

get back on the rails

(informal) to become successful again after a period of failure, or to begin functioning normally again

He has helped get the company back on the rails again.

go off the rails (informal)

jump the rails

to leave the track suddenly