Rigorous reason behind internal energy change being zero while mixing
The process in question is presumably adiabatic, since we are told that the temperature changes and are not given any information about the temperature of the surroundings (adiabaticity can also sometimes be assumed if gases are mixed rapidly). Secondly, the final volume of the system (the entire container) is the same as the initial volume (and in addition we can assume that each gas expands without performing any work, i.e. the expansions can be assumed to be free). That means that neither heat nor work exchanged with the system during the process, which means that in accordance with the first law $\Delta U = 0$.