The change in internal energy of the system is given by the first law of thermodynamics:

where
Q is the heat added to the system
W is the work done by the system
In this problem,

(with a negative sign because the heat is released by the system (not absorbed)), and the work is

, with a positive sign since it is performed by the system. Therefore, the variation of internal energy of the system is

So, the internal energy of the system has decreased.