It appears to have a line cord (110v) with one leg wired through a sp-st toggle switch -- then there's a power transformer, so that makes a basic low-voltage AC power supply with an on/off control; then there's probably a rectifier in the circuit somewhere; there are various resistors and capacitors (including what looks like a long adjustable resistor), and also what looks like a relay or two.
Perhaps it is an old D-I-Y automatic reversing display track for a locomotive, with some sort of slow-down cycle at each end that somehow works by cutting in the multiple small resistors one by one, and then a detection circuit of some kind to operate a relay to change polarity, then some mechanism to increase speed again by cutting out resistors.
This is obviously just a wild guess, but I'm trying to account for the weird complexity of the many components and wires inside.