To answer my own question: you can still set markers even when you are stuck, so repeatedly setting and jumping to marker will move you more and more backward. The whole process is not quick, but unless there's a train behind, you will be free at some point.

