This object is a police truncheon. It is made of wood and you might imagine that it was used in maintaining law and order. But is that the whole story?
The earliest railways had no signals. Railway policemen were stationed along the line so as to prevent trespass and damage but also to indicate to approaching trains whether or not the line was clear. Later they began to use flags, painted wooden boards and lamps. Until the general adoption of the electric telegraph around 1860, there was no means of communicating with other points along the line. This was a particular problem on single lines, where trains might travel in either direction.
The policeman would hand his truncheon to the engine driver as authority to proceed. The driver would hand the truncheon to the next policeman along the line, who would give it to the first engine driver travelling in the opposite direction.
So the real use of this truncheon was to control the movements of trains so as to prevent head-on collisions. Because they had originally been railway policemen, signalmen were commonly referred to in later years by other railway workers as bobbies, and the truncheon or staff was known as a bobby stick.