Why do trains sometimes stop on railroad crossings, blocking the path of automobiles and other roadway vehicles?

Freight trains can approach 1.5 miles in length while adjacent crossings are often spaced much closer than this so few areas exist where a train can stop and not block at least one crossing. Trains may stop due to a mechanical problem or while waiting for other trains to clear off the route. Dropping off or picking up train cars from rail yards or industrial plants is another reason why trains may be stopped on the tracks.