Speed restrictions for heat are definitely a thing. The rails can expand and buckle. Yes it can be engineered around, to a point and for a price, so that is usually limited to places that routinely get extremely hot. Elsewhere, the trains have to slow down in extreme heat.
Here is some more...