How did scientists determine the difference in the age of rocks near mid ocean ridges from those farther away from ridges?

Good question: Geologist use these methods to determine the ages of rocks. The absolute age of the rock and relative age of the rock. Now because the mid ocean ridges are place of divergent where plates move apart, the rock farther away from the ridges are older than the younger ones that are just form close to the ride. This is called relative dating. The absolute dating use Isotopes and radiometric dating meaning they have to have a hand sample to determine this. But I think the best method here for situation like this is the Relative ages of the rocks.