Won’t work, because you’re not creating energy, just changing how it’s let out. The total power will always be the same.
Power = Current x Voltage
Let’s look at a standard transformer: On the input (wall outlet) side, you’ve got 120 volts, on the output side 24 volts to go to your trains. If you’ve got a current draw of 1 amp at 24 volts, your total power output is 24 watts (24 volts x 1 amp). On the wall outlet side of the transformer, you’ve got 24 watts = 120 volts x 0.2 amps. Since the voltage is 5 times higher, the current draw is 5 times lower. The transformer is not creating energy, rather just changing it to be more useful.
Now, as cacole mentioned, transformers need a varying voltage to function–typically AC, but can also be modulated DC. There has to be a changing magnetic field for a transformer to work. You don’t get that with batteries–their output is linear, so the magnetic field is constant.
Now, let’s look at your battery scenario. You’ve got 8 cells, all rated at 1 amp/hour (meaning, they’ll deliver one amp of power for a total of one hour, or 2 amps of power for 30 minutes, or 0.5 amps for 2 hours.) Now, if the cells are rated at 1.2 volts (common for NiCd or NiMH batteries), that gives you a total of 9.6 volts when hooked together in series. Now, let’s say your motor draws 0.5 amps. The motor will run as fast as it will at 9.6 volts until the batteries die, which at 0.5 amps will be two hours.
Now, if you hook them up in parallel, you’ve got a 1.2 volt battery with a life of 8 amp/hours. Now, 1.2 volts isn’t going to turn your motor, you need more voltage. Now, we’ve already established that a simple transformer won’t work, but let’s keep going on the premise of some kind of electronic mechanism which would allow you to increase the voltage. So, you take this battery and hook it up to this circuit so your output is 9.6 volts. (Keeps the math easy) The motor still draws 0.5 amps, so your total power is 4.8 watts. On the batter