In each building there is a system which takes the district heat and uses it to heat the water of the building. Both hot tap water and central heating. But the water is separate from district heat, so in each building the temperatures can be adjusted.
In older buildings you still have the issue you describe on a macro level - apartments on the bottom floor are too hot, and on the top are too cold - but it doesn't matter how close or far your building is from the district heating station.