As I understand the parlance, almost any vehicle that pulls or pushes a train down a track is a locomotive.
Over the years a lot of power sources have been tried out. If you don’t count horses and mules, first there was steam power, and compressed air, straight diesel, electricity, and diesel-electric. Except along the Northeast corridor and a few other places, where pure electrics rule,* the “winner” since just after the end of WWII seems to be the diesel-electric locomotive, which is commonly referred to simply (but incorrectly) as a diesel.
Inside a diesel-electric locomotive is a large diesel engine, sometimes called the “prime mover.” It’s purpose is to drive a generator or alternator to produce electricity (either DC or AC) which in turn is fed the the “traction motors” which actually drive the wheels Having electricity as the final step in the power-process greatly simplifies the overall control system for the train.
The prototypes for the model locomotives that you inquired about are both diesel-electrics.
The terms locomotive and engine are used interchaneably by the public. The terms engine and motor have special meanings, mostly lost in the mists of time, in both the toy train world and the real world, both within the realm of trains and totally outside of it. Check Wikipedia or just Google the terms.
This is very basic, and as such is a gross over-simplification, but it’s a start. Terminology can vary by railroad, region, country and over time.
*The “pure electric” locomotives get their power from overhead catenary wires or, more rarely, from third rails. Toy train model locomotives are almost all electric, but there have been a few that were powered by wind-up clockwork-spring motors, and a very few powered by compressed air and other interesting methods, from batteries to heavy flywheel