One of my clients manufactures those "silver sheds" and fills them with the specified signaling equipment needed by the railroad. Their products include the crossing lights and gates. I've been able to look inside some equipment as it was "in-process" in their facility and found it very interesting. They've got shelves and racks that are similar to those used on radio sites. Their cable management is at least equal to that seen on radio sites. Of course, some of the newest of those "silver sheds" contain the signaling and radio equipment for Positive Train Control as it gets rolled out across the nation's railroads.
Some are defect detectors as shown in the link, these contain the radio and can be detected by a small antenna, either directly mounted on the cabinet (often an NMO mount) or on a lineside pole nearby. These antennas are usually pretty low key, and can be discerned from Road channel radio antennas that usually are mounted higher with high gain models.
Some contain grade crossing equipment that control the gates, lights and audible warning devices.
Others contain signalling gear, such as track occupancy and signal controls etc. that work with the various signalling, communications and control systems.
Some contain pieces of a combination of all of the above.
There is a cabinet near me that contains controls for a grade crossing, a remote access lineside radio on the local Road channel and control of a block signal. I had a chance to go in and view the various stuff with a friendly maintainer who described each piece of gear. At the time the radio was a simple GM300 with an Astron power supply connected to a leased phone line that allowed access from the dispatch office in Omaha. There is a signal just north of the box that at the time was ABS but now I think they extended the CTC thru the area. In addition they had the controls for the gates and other warning equipment for the grade crossing all in the same shed.
Another shed on a different railroad nearby that I have seen contains the defect detector equipment and has a small VHF quarterwave antenna on the cabinet itself. This had a Kenwood mobile radio also with an Astron power supply. There is a signal nearby but it has its own cabinet up the line a few hundred feet.
N9JIG Hit the nail on the head. Like he said the ones near the crossings control the crossing when the engine comes within the limits of said crossing. Some are radio/DTMF controlled, some have manual control, some are dispatch controlled, but most are just automatic. Railroads today use fiber optics buried next to the right of way so MOW crews and maintainers can access the wiring and controls for various right of way equipment. They have defect detectors, switch controls, signal controls, greaser controls, AEI tag readers for car reading, crossing controls, and even call boxes when the radio breaks, but that rarely ever happens and with cell phones there's very few left...
Detectors can be a bit funny at times. I was traveling on Amtrak's Coast Starlight between Los Angeles and Seattle and could hear the detectors on my scanner. At one point, according to the detectors, the train became shorter by three axles...
Almost anytime you hear a train with an odd number of axles you have a detector that miscounted. About the only reason I can think of that would really be an odd number is when using one or 3 of of those hybrid B-A1A FL-9 and Consolidateds that the New Haven had...