Indeed there are battery back up systems in place. But this knowledge often times will lull one into a false sense of security. Even with back systems in place, these devices ARE NOT FAIL-SAFE.
Twice in my own lengthy career, I have operated trains over public crossings at grade where the gates were INOPERATIVE. These were not out of the way crossings in the middle of nowhere, but rather one busy secondary road and a state highway.
Granted, both instances were precipitated by an odd combination of events, but the point is, it CAN happen. Before crossing any tracks, whether on foot or in a vehicle, LOOK, LISTEN and LIVE. There are no second chances.