Nearly all level crossings are required to, at the very least, trigger a signal with audible sounds and possibly gates, so you just need that same switch to update some online status.
Many crossings in th US actually do not have any warning lights or gates, the only warning of an approaching train is the horn from the locomotive. Low-traffic (either in terms of cars or trains) crossings are often unsignaled.