Really interesting all the various suggestions for No. 5 - it was advertised to me as European Train Control System (ETCS▸ ) tracked box - that system that's used on the Shrewsbury to Aberystwyth and Pwhelli lines to avoid trains colliding without physical signals. But I suspect that in that box you could put all sorts of things!
I think you were correctly informed Graham. The ones I was thinking about look
like this. We have a similar one beside our track at Princes Risborough.
The object itself is a balise, or Eurobalise; I think that one's by made by Siemens. The mounting beam is a separate product made by Pandrol; it avoids having to drill holes through concrete sleepers. Basically it tells the train where it is. Even in its basic form, with no connections to it, it can still transfer various other bits of data defined for
ERTMS▸ , but some only give ID and position.
They are used in ETCS, since the concept of a "movement authority" relies on the on-board control box knowing where the train is. You only need to add an odometer to provide positon between balises, corrected for drift at each balise, for a basic ETCS implementation.
Since the basic function of the balise is to say "you are here" with an ID code, there is nothing to stop you using them for other things just by programming the on-board systems. If you don't have ETCS it's particularly easy, since compatibility isn't an issue. Examples are train control functions like train stopping positon, station ID, selective door opening. But even a quite different design of object in the track (and even if not yellow!) can still be called a "balise" since that's just the French word for a lineside positon marker.