Train detection with a reed switch and a magnet
With a digital model railway, train detection (block signaling) is an important function. Most often current sensing is used. It is quite reliable and you don’t have any (possibly ugly and always non-prototypical) sensors in view. The drawback is that it probably also is the most expensive method.