Every part of the long railway track has connected through a special joint. It named the fish plate. It looks like this.
The plates placed at both side of railway track and fastened with nut and bolts tightly as seen on the image. The plates called a fish plate. You can also see a small gap where two railway track connected within.
Keeping the gap between two consecutive railway track railway engineers eliminate the possible cause of accidents for expanding and contraction of railway steel metal track according to temperature difference in different seasons.
At the hot seasons when railway track expands it fillup the gap and when in cold due to contractions of railway track metal the gap will expand. But due to this gap, there are no abnormalities of the layout of Railway tracks. It remains straight.
There is no problem of running of the train upon the railway track over between the gaps of railway tracks of fishplates.
Nowadays the fish plate becomes obsolete. The railway track now comes in long in length and fish late remove by over lapping section like this.
Here expansion and contractions of railway tracks causing during temperature dependence and absorbed within overlap portion of railway track.