Technically, you could just pump out hot water and pump in some cold water, on every station.
But achieving reliable coupling between the train and any kind of piping system would be complex. Remember, there is electricity involved already and you don't want to mix leaking pipes and electricity.
When you realise you have to do something very reliably on every train stop, on every car a more passive solution like piping cold water through the rock might be cheaper long term.