I recently realised that all of the basic technology needed to operate a micro-layout (direct current circuits, voltaic batteries, primitive motors) had been developed before the 1840s started. Reading a bit further, I discovered the US inventor Thomas Davenport - not the very first person to build an electric motor, but almost certainly the first one to use it to power a model tramcar in the mid-1830s. His design was elegant, but not ideally suited for today's smaller scales: