https://wiki.openraildata.com//index.php?title=Main_Page
Some crossings in the uk are directly available as a state within the data, mine is not so I have to track the trains into and out of a region. When the train enters the region, I assume the crossing must be down and when it leaves, I assume it must be up.
Its about 30 seconds to a minute off, but for my purpose that's OK.
There's a level crossing a few miles from me that has automated barriers. The tricky bit is the crossing is right next to a station and there will be various rules in force:-
* barriers must be down at least X seconds before a train is due to go through
* barriers must be down even if the train is coming in to the station to stop (before it gets to the crossing) - the barriers must be down in case it overshoots
* etc
Whilst the barriers can go up as soon as a train has passed there may be another one along shortly enough that it's not worth opening the barriers only to close them a few seconds later.
Combine those with a timetable that puts 10+ trains an hour each direction and the barriers will probably be down for longer than they are up in peak times. I've seen them down for 10+ minutes at a time.
Here's the google streetview that just happens to have a train that has already passed and stopped at the station: https://goo.gl/maps/jhzApjZHUAJ4FcSt6
As a pedestrian (or a cyclist without lots of luggage) it's often faster to use the footbridge to cross rather than waiting for the train(s) to pass and the barriers to rise.
I work in the traffic industry.
If we can slow people down before they reach the queue, then we can reduce the impact of them joining the queue (co2 etc....).