Which one is better the reed switch or the electronic sensor?
They are very similar in terms of range, both have a range of about 3mm max which I suspect is a lot shorter than you were thinking.
The hall effect being solid state lasts a lot longer but we are talking of many years in this sort of application even for a reed switch.
I suggested a compass because the range would be greater but a lot more difficult to interpret. Basically it will be a point where the field changes rapidly and not in response to your direction of travel.