How would "magnets" be any improvement over visual markings? Is there some sensor that can track magnets at greater distance, or with greater reliability than visual markings?
Besides, how many millions of miles of road would need to be equipped with these magnets around the world? What would that cost? Would it be acceptable that autonomous cars could only drive on roads that have been properly equipped?
It's worth remembering that self-driving AI does not solely rely on lane markings to navigate. It also can see the road edge, follow other vehicles, and cross-reference with a (learned/crowd-sourced) navigation model of the laneway. Additional sensor types, like LIDAR and radar, are often used in addition to cameras.
You can see a lot of this at work, in a complex London traffic environment, in this demo: