A motor produces locomotion. It makes other things move.
An engine produces power. Locomotion can be derived from power but isn't required to.
A train locomotive might be referred to as a "locomotive engine".
A car with an internal combustion engine moves from power generated by that engine. But a car with electric motors does not have an engine because power is not produced there. Power is produced elsewhere and then stored in the battery. Locomotion is produced by consuming the stored power.
Of course, that's just my interpretation of the two words without referring to a dictionary.