Blue flags are used on a railroad to protect the track behind the flag. Once active, the flag implies that people could be working along the track, either directly on the track or on nearby rail cars and the flag is used to protect them; no trains can move across the flag. The flags I’ve seen in the past are steel plates welded to steel rod “poles”. At their base a simple C-shaped clamp is provided and the flag is designed to rest atop a rail. I photographed this one in the CN yard in Dartmouth, NS. If you look closely you can see that it’s bolted to a railway tie and is a permanent fixture. I don’t have a track plan for the yard and I’m not familiar with operations within the yard but assume that the sidings behind this flag are designated places to place cars requiring repair work. Once a car is set out one on of these sidings the flag is raised, “protecting” the track behind it.
I don’t have a place on my layout for one of these but I’d really like to build a model of one. I’d attach a simple motor drive beneath the layout and use that to raise and lower the flag. Cooler still would be to try and figure out a random timer to raise this flag at random times during an operating session and provide some entertainig challenge to operators working around the flag. The flag itself is really simple and wouldn’t be hard to model at all, even hinging it should be fairly simple.