To finish our schematics, we must define the model of the hall sensor we are going to use. So I have made some tests with them, and determined the best model would be the A1121. It works up to 6mm away from our neodymium magnet, making it possible to be placed under the rails. The A1122 model decreased that distance to 2mm, obviously not adequate for our project. I added a 500Ohms (the largest I had) resistor connected to the VCC, to define a voltage for the high impedance state. It works flawlessly even at speed.
The photo below illustrates the circuit I used. If you look at the oscilloscope, you can actually see two detections, one for the first magnet, and another for the second. It is achieved using its persistence function. I also tried to evaluate the effect of having the rails powered with +21V, and the results remained the same.