roads and streets closely parallel to train tracks and so when a road or street crosses those tracks there is a traffic light or stop sign and what can happen is people see a green light or a yellow light and they proceed to try to make their turn etc. but can get caught by traffic or a light turning red before they can make their turn. So now they are on the tracks. This happens with cars too where there is only space for one car past the tracks and before the traffic signal. One car follows the other on green over the tracks but then the light turns yellow but instead of completing the turn the first car stops and now the second car is on the tracks.
The situation here seems to be that the warning was going and the gates are down. However just based on the video it looks like situations I've seen where there is a vehicle in front originally and the trucker mistakenly follows that vehicle and then is on the tracks. The driver may have realized his mistake and tried to proceed into the intersection but there was no time. Notice that in the beginning you do see the traffic light turn from red to green but we can't be sure from this angle whether that is the light for him or the traffic perpendicular to him. One thing we can be sure of is that when one light changed the other did also. Driver error and back in the day one of the first things a trucker was told is "don't ever get caught having to stop on the tracks". So the right thing to do is to wait until you are sure you can go over the tracks and complete your turn in one complete movement. Sometimes, obviously not here, even in the best of efforts to do so somebody pulls out from a parking spot etc. or a pedestrian starts crossing once you have started across the tracks and what you thought was a clear path to make your turn vanishes and then a light turns or you have to wait for even more traffic that is now coming.