How to determine if a mixing process is spontaneous at constant temperature but variable pressure
Volume of H2 = $\frac{nRT}{P}=\frac{(2)R(298)}{2}$

Volume of N2 = $\frac{nRT}{P}=\frac{(4)R(298)}{3}$

Total volume = $\frac{7}{3}(298)R$

Final pressure = $\frac{nRT}{V}=\frac{(6)R(298)}{(\frac{7}{3})R(298)}=\frac{18}{7}\ atm$

Final partial pressure H2 = $\frac{18}{(7)(3)}=\frac{6}{7}\ atm$

Final partial pressure N2 = $\frac{18}{7}\frac{2}{3}=\frac{12}{7}\ atm$

$$\Delta S=-n_{H_2}R\ln{\frac{\frac{6}{7}}{2}}-n_{N_2}R\ln{\frac{\frac{12}{7}}{4}}=-(2)R(-0.8473)-(4)R(-0.8473)=5.08R$$

For ideal gas mixing, $$\Delta H = 0$$

Therefore, $$\Delta G=\Delta H-T\Delta S$$

Another way of doing this is to (a) first allow the divider to float so that the two chambers equilibrate in pressure and then (b) remove the divider and allow the gases to mix.  You calculate $\Delta G$ for each step, and then add them.  In the end, you get the same answer I got.