Simple i/o sensor to detect contact/touch

As they said an IR beam, out them down a tube at each end as you want as narrow a beam as possible. Place the IR emitters on the bottom and the receivers above the track. There are piles of pinewood derby setups that use this method.