The common form of "fibre" broadband is Fibre to the Cabinet - the fibre runs only to the cabinet, then the signal continues over a pair of wires from there. From the cabinet it uses a form of DSL called VDSL2, and, like all DSL, the available speed depends on various factors, primarily the length and quality of the pair of wires.
It sounds like your service is provided using the wholesale 40 down and 10 up Mbit/s service, which, allowing for overheads, has to be described as "up to 38 Mbit/s" in any advertising. Your neighbour's line may run to a different cabinet, to the same cabinet via a slightly different route, using a pair of wires that turn out to be of better quality than yours (a particular issue if the wires to your houses are overhead - the overhead dropwires deteriorate over time), or may occupy a more favourable position in the cable bundle with regard to crosstalk (which can limit VDSL2 speeds significantly). Such, unfortunately, is the nature of the FTTC technology.
The FTTC deployment is enabling for future technologies that run fibre closer to the end user or all the way to the end user (FTTP), but these are too expensive for widespread deployment at the moment.
The only slightly curious thing is your mention of "the exchange equipment I am connected to is rated at only 24M". 24 Mbit/s is the maximum downstream speed for ADSL2+, achievable only on the shortest lines. Most likely, this figure is the BT Openreach FTTC speed estimate for your line, which you are a little short of (unusual, as these estimates are normally rather conservative, but it does happen). Are you absolutely sure you're on a fibre service, which would mean an engineer had installed a white BT Openreach modem to which you connect your router.