Several comments mention track buckling in extreme heat.
When this happens, how is it resolved ? Does the track usually revert to its original positioning at all points, or does every stretch of recently-buckled track have to be inspected and possibly realigned ?
It depends on the severity of the problem. The track may satisfactorily straighten itself out as it cools. It might mostly straighten itself out, but there could be lasting geometry problems from it settling differently than it was before. This will need to be corrected by a tamper, which basically vibrates the ballast under the tracks so it "flows" as the track is pulled into the correct position. In especially severe cases, the track may need to be inspected and have some hardware replaced---things like joint bars and track fasteners.
Tampers have a reference system based on axles far apart whose relative positions are measured by a simple optical setup. So especially with modern computer controls, the operator can program the correct track profile into the tamper and then it slowly advances along the track pulling it back into position. Since tampers are slow and there are only so many around, a lot of railroads have work trains or even hirail trucks with optical equipment to measure the track geometry so that they can inspect for tolerances more frequently. The exact tolerances depend mostly on running speed... a train moving very slowly can often handle even badly out-of-alignment track as long as it is well attached to the ties (so the distance between the rails stays correct). So you will often see industrial sidings in really bad shape since they're only used occasionally at 15mph. But once trains get up to 50mph and faster they become a lot more sensitive to the geometry and you start worrying about damage and derailments if things are out of whack. So the mainline track gets inspected a lot more frequently, often a simple visual inspection by MOW workers in a hirail is done daily besides of course train crews reporting areas with a rough ride.
When this happens, how is it resolved ? Does the track usually revert to its original positioning at all points, or does every stretch of recently-buckled track have to be inspected and possibly realigned ?