Trains are the first electric driven items.... Huge generators power electric motors that power the train...
Well, yes and no. The first known electric car of any kind was 1828 by a Hungarian. In 1834 a Vermont blacksmith came up with a small electric car that he ran on an electrified circular track. In 1835 the first car powered by non-rechargeable batteries was developed in The Netherlands. The German
Flocken Elektrowagen of 1888 is regarded as the first real electric car of the world, because it had a reasonable range and thanks to the invention of lead acid batteries it could be recharged.
The first electric locomotive of any kind was invented in 1837, invented by a Scottsman, using basically the same non-rechargeable batteries as the 1835 car. But it could only haul 6 tons for a distance of a mile and a half. In 1840, based on the electrified track of 1834, a patent in London was issued for an electrified third rail for railroad trains (a similar patent was issued in the US in 1847). These early trains, even the ones on electrified rails, were used for short distances, mainly to move material in and out of mines (no coal soot or steam). Further advancements were made in 1879 with a 300 mile circular track using a third rail that carried passengers. Then it evolved to longer lines, overhead trams, and subways and tunnels. In the 1890s locomotives found their groove with AC electricity.
Basically, the same technological evolution that happened with electric cars was also immediately applied to trains. And while trains might not technically be the first electrified vehicles, they certainly were better to exploit the technology more efficiently and longer term.
Electric cars were very popular beginning with that
Flocken Elektrowagen in 1888 up until about 1920. Electricity was really the most preferred method for automobile propulsion, as it provided a level of comfort and ease of operation that could not be achieved by the gasoline cars, nor the pollution of coal-fired steam engines. Back then everything was better electrified. Electricity was the Bluetooth of its day. But advances in internal combustion technology that enabled a much greater range, and along with a growing petroleum infrastructure and faster refueling times reversed the benefits of electricity. On top of that, Ford's mass production lowered the price of a gasoline automobile to half that of an electric vehicle. By 1930 there weren't really any electric cars to speak of.
But now, thanks to the advances in battery technology, the high price of gasoline, and the same environmental concerns of 130 years ago, the same thing will happen to the gasoline car that happened to the electric car. Nobody had to pass a law in the early 1900s to get rid of electric vehicles, it just happened. They don't need to pass a law to ban internal combustion engines, either.
For trains, I would expect that the population centers like the northeast corridor will expand their electrification, but I don't see much electrification for long distance trains. I would think those would continue with diesel-electric locomotives for many years to come (diesel engines turn the alternators which power the electric motors that drive the wheels).