The connections you mention are wired directly to the motor etc. and although they are there for providing power from the locomotive to other wagons (such as for lighting in a passenger coach), they can indeed be used to provide power to the locomotive. The only downside is they will feed power to the tracks as well through the wheels and skates. You can find a diagram here; not truly a wiring diagram, but it does show the wiring.
"It is one of the happiest characteristics
of this glorious country that official utterances are invariably
regarded as unanswerable."
-Sir Joseph Porter, First Lord of the Admiralty (HMS Pinafore)