"sun kinks" as they are called, are indeed a common problem faced by railroading everywhere temperatures get warm and welded rail, or even 78' sections, are used. this is one of the reasons rail anchors where invented.
not that they solve the problem entirely, the just lock the rail from creeping in relation to the ties so that gauge is maintained, although kinking of the entire rail structure is not prevented entirely. on modern rapid transit lines, like bart, the use of paved continuous track system with pandrol clips seems to work.
for long distances on class one heavy main lines this might not be entirely a practical solution economically. there, rail anchors are quite common.
=^^=
.../\...