Answer
$T_2=85.7°C$
Work Step by Step
For ideal gases:
$PV=mRT$
Given $P_1=500kPa,\ V_1=1m³,\ T_{1,He}=40°C,\ T_{1,N_2}=120°C$,
$R_{N_2}=0.2968\ kJ/kg.K, R_{He}=2.0769\ kJ/kg.K$
solving for the masses we get:
$m_{N_2}=4.287\ kg,\ m_{He}=0.7691\ kg$
The energy balance for the system is:
$\Delta U_{N_2}+\Delta U_{He}=0$
With $c_{v,N_2}=0.743\ kJ/kg.K,\ c_{v,He}=3.1156\ kJ/kg.K$:
solving for the final temperature:
$T_2=85.7°C$