This toy uses the shape memory property of Nitinol wire. It's far from obvious how it works and the description in the instructions is not much help:
This heat model operate by using the shape memory alloy wire & the hot water as the heat source. When the hot water temperature is above the wire’s transition temperature, the wire’s curved part will become straight. This makes the flywheel go round & round. –converting heat to mechanical energy.
I'm not sure if my description is much better (or even correct): The engine consists of a loop of Nitinol wire, loosely wrapped round two pulleys; a large one at the top in (relatively) cool air and a smaller one with it's bottom edge in hot water. This part of the wire is heated above it's threshold temperature and the wire tries to return to it's natural shape, which is straight. As the wire travels up and over the larger wheel and down the other side, it cools off and can then be bent into the small radius of the smaller wheel. It is then immediately heated up again to repeat the cycle. It will run in either direction, determined by how it's started.