On the problem of railway lane change
Please look at my picture, which is the missing part in your picture. The answer to the question is here. The intersection of these two railways is called a turnout, which is movable. At present, the train is running on the right line. Turnouts are divided into straight forks and reverse forks. Going up from the bottom of the picture is called a reverse fork. The turnout is over there, so the train will go in that direction and won't derail. On the other hand, walking from top to bottom is called crossing. At present, only the right line is open and the left line is closed. If there is a train on the left at this time, it will derail, or at least the switch will get stuck. I am a train driver, not a line major. I just use the common language. You got it? Hmm. How interesting