Is there a way to change the distance to trigger the railway crossing guards to close and open?
On one of my layouts the Xing is very close to the station and so the guards stay down when the train is at the station.
Ther are a couple of ways to do what you want. I believe there are crossing by BNSF on the DLS, can't remember the crossing name, that allow you to specify when the gates will open. The other way is a method I devised in TRS2004, see pic below.
The invisible junctions must be set to default to the deadend invisible track. When a train arrives at the station and loads the invisible junction will not change until the loading has completed and the train is looking for the next trackmark, but a train not stopping at the station will trigger the crossing at the normal distance.