Of course being an average there are cooler times in the Sahara. But they have a couple of months where it doesn’t dip below 42c not a couple of days where it is that high. They also have colder nights at times than we do.,Heaven knows how the railways here and others would cope with that.
If you build a railway in the Sahara (as they did), you build it to cope with temperatures that exist in the Sahara.
The railways here were built to cope with temperatures up to 30 degrees, so are fairly useless when it gets to 40 degrees, though to be fair, tomorrow will be the first time in recorded history that the UK will hit 40 degrees.