Dear Student,
In case of i) burning of petrol in engine of a car: Here petrol burning without air so the efficiency is maximum in this case. Here engine of the car is closed and contains nothing. It is close so almost all energy produced due to burning is used so efficiency is more.
On the other hand ii)Burning of petrol in open: When petrol is burning in open then the oxygen is also associated with it and combine with in the process. Here efficiency of the petrol decreases. It is a open system so a lot of energy goes out and the efficiency decrease.
In the above two processes energy changes will not be same it will different.
In case of first one energy is more. But in case of second one energy is less.
Regards