It doesn't matter when the train sounded the horn. Whenever you cross any railroad tracks, you have the responsibility to ensure that they are clear before you cross. No matter how many times it happens, there is simply no excuse for a truck, or any other vehicle, being hit by a train. Whenever that happens, unless the truck has gotten high centered on the tracks, or a car that has stalled on the tracks, the driver of the vehicle is immediately at fault. In those rare instances, the first thing you do is get out of the vehicle. Trains run on tracks, always have, always will. That simple little fact makes it very easy for a driver to avoid them.