I’ll assume that you are asking how a train engine creates and harnesses the energy required to move, or, what kinds of engines they have and how they use it to move the train.
SHORT ANSWER: Most trains use one of three methods to run:
Diesel engine inside train drives a generator to make power, and power turns motors that connect to the wheels;
Power is taken from a power line above the train and that power drives motors that connect to the wheels;
Diesel engine inside train directly drives wheels by the use of a fluid filled transmission like in an automatic vehicle (like a car, but heavier. Used for lighter trains only)