Both have a diesel engine. In a diesel electric the engine drives an alternator/dynamo which provides electricity to power the electric motors on the axles. In a diesel hydraulic, the engine powers a hydraulic pump in the hydraulic system which provides power to the hydraulic motors on the axle.