Each rail has an electromagnetic field. Like a long wire. There are convergent fields that vary with length. In fact the railroad use the rails for signal transmission. Try using a compass close to the tracks and you will see how it varies. The more altitude the less interference.