Better or richer schools will always have an advantage over schools with worse teachers or less funding, particularly with the way we currently do exams.
The last two years of school are generally a prep course for the German SAT equivalent (and grades in those two years account for around two thirds of the final score).
In which case schools located in areas with a higher cost of living are effectively receiving less because any teacher working their, while on an absolute scale making the same, is making less on the more realistic scale that adjusts for cost of living.