They are also not entirely safe because people are idiots and get stuck without understanding that they can actually push through the barrier.
Ones with nothing except signs to stop, look and listen. You're most likely to find this while hiking, as a footpath crossing.
Flashing lights and beeps.
Half barriers, which only cover half the road (one lane in each direction). These are my automatic. Drivers can't get trapped.
Full barriers. These all have CCTV, and the train won't get a "green" until the signaller has seen both barriers close, and that no one is in the middle. These are used in cities and other busy places.
We also still have some full barrier crossings operated by a signalman near me. There's something pleasing about that.
Most of the barriers I see in the US are one sided - they don't let you drive on to the tracks, but there's no barrier that prevents you from leaving.
One could argue all those people are insane, but there are a lot of them.
Sometimes it's the impatient person who is tired of waiting as the signal has been going for minutes and there's no other evidence of a train.
Sometimes it's the inattentive person following the car in front.
Gates help the third person most. I haven't seen many crossings without gates, but they're a lot easier to miss than a gate.
Protecting people from a train collision has benefits for the train system as well. A collision causes confusion and delay and may damage the rolling stock or even the rails and could cause injuries and the operators likely need PTO. So it's rational to reduce collisions regardless of opinions about the choices of the participants.