After an introduction on the basic aspects of electric railway transports, focusing mainly on driverless subways and their related automation systems (ATC, ATP, and ATO), a technique for energy optimization of the train movement through their control using genetic algorithms will be presented. Genetic algorithms are a heuristic search and iterative stochastic method used in computing to find exact or approximate solutions to optimization problems. This optimization process has been calculated and tested on a real subway line in Milan through the implementation of a dedicated Matlab code. The so-defined algorithm provides the optimization of the trains movement through a coast control table created by the use of a genetic algorithm that minimizes the energy consumption and the train scheduled time. The obtained results suggest that the method is promising in minimizing the energy consumption of the electric trains.