A locomotive is powered by a steam engine, with the sole purpose of moving itself and other rail cars. A steam engine was used for locomotives, boats, and other machines, like water pumps in coal mines and factories.