What is the thought behind the time a barrier descends to when the train crosses. At a certain town 'X', the full barriers are down for over a minute before the passenger train trundles in or out of the adjacent station. For years local residents complain about the whole town jammed up by gridlocked cars due to the barriers. Nearby is an A road with half barriers, barrier down, 15 secs, train passes at speed, I. E. Much more dangerous.
It's mostly down to the kind of level crossing and the proximity of any station.
Where a crossing has automatic half barriers (AHB), trains can receive a green aspect before the crossing has even started its sequence. This is because anyone stuck on the crossing should be able to easily 'escape' if they cross too slowly/late, by nature of the half barriers. Therefore the barrier down time can be very low, as the crossing is purely lowered by the approach of the train, such that the amber light illuminates at least 27 seconds before the train passes.
Where a crossing has full barriers, it must (normally?) be interlocked with the signals. This is to prevent the possibility of someone being stuck on the crossing between two locked gates, with one or more approaching trains being unable to stop. Therefore the crossing needs to be lowered with the train much further away (at least the braking distance, which can be more than a mile on high speed lines) for the train to receive green signals.
This is further complicated where there is a station near the crossing, as there is fine line to be trodden between not unnecessarily slowing down the train on approach to the station and keeping the crossing closure as short as possible.
Unfortunately, whilst better for road traffic, AHBs are much greater safety risk in most circumstances, and will rarely be acceptable in busy town centres.