Azatrax has a great infrared system for detection, plus a whole bunch of crossing signals and gates (most of which are OEM items). My problem with putting working gates on my layout is that I very cleverly put my grade crossings right smack over the framing members before deciding I needed "protection" for the vehicles approaching the tracks! As most gates I have seen require some clear space under the layout for the actuation system, this doesn't quite work for my layout. Motorists will just have to "watch out for the cars", the flashing lights and bells. This doesn't matter too much, as my roads end at the edge of the layout or at a wall!
The main advantage of IR is that it is independent of track power. The detectors can be either buried in the center of the roadbed, so they depend on reflection off the underside of the rolling stock, or placing them above the track so the rolling stock breaks the beam. The detector and the emitter are located in two poles which can be painted to look like some sort of utility feature, or hidden in a trackside building. Oriented the right way, you can cover more than a single track, say a main line and passing track, or some other arrangement. Azatrax's system can also be used for block detection. I haven't talked to John in several years, but he was always very helpful when I first got started!