Take an example from before heat engines were developed. In France, they wanted to move water uphill. They used gigantic water wheels to run belts, that ran a series of smaller wheels, that carried some of the water uphill. This was tremendously inefficient. The water that reached the higher level was a tiny fraction of the water going down the river, pushing the wheels.
Here is a modern version of that! Much more efficient. This is a water driven water pump. As you see, it takes far more water going downstream to push this than the amount of water that goes a mile up the hill to the fields. Overall, it produces no net energy. You cannot use it as a perpetual motion machine. It is useful because these people have a lot of moving water in a large stream, and they only need to pump a small amount of that water uphill.
These Water Wheels Can Pump Water Over A Mile Without Electricity