I recently saw this on a caboose in a train museum. The guide didn’t know what this fixture was for.
She said that the caboose was home to the conductors, who could climb these little ladders into a loft space with big windows where they could get a good view of things and signal the engineer with flags.
Nicely done, answered in one. I did speculate that it might be for the flags, but I wasn’t sure.
I see now that it’s supposed to have two rows of holes, but the front half of the unit is broken off and then painted over obscuring the fact that it was incomplete.
I guess they must still be in use, since those are apparently modern flags with modern meanings. None of those messages really seems like something a conductor would signal the engineer from the rear end of a train though.
In Canada, despite pressure from rial unions, the caboose has disappeared. IIRC it’s been replaces by an electronic box of the last car that can monitor the train and perform tasks like activating the brakes, sperate from the front controls, should that be needed.