That was in the Red / Green / Blue mars trilogy, one of my favorites. Though I think I’ve seen the concept in other works as well.
Basically the temp difference between day / night caused contraction of the rail tracks, pushing the whole city forward so it was always just ahead of dawn.
I’ll have to get 2312, haven’t heard of that one. Same universe?