It sounds like you may have a short circuit somewhere.
What transformer are you using, and what kind of track?
Finding the problem is a process of elimination.
Disconnect the transformer from the track and check the voltage at the plug. If it cycles on and off, the transformer is your problem. If power only cycles with the transformer connected to the track, there is a short in the track somewhere. To locate it, disconnect one track at a time and power up the layout. Keep on disconnecting one track at a time until the short disappears. The last track you disconnected will be the bad one.
If the transformer and track check good, the problem is your locomotive. It may have bad wiring or a bad 'E' unit.
Larry