Hai khí là $H_2$ (x mol), $N_2$ (y mol)
$n_{khí}=\dfrac{1,12}{22,4}=0,05 mol$
$\Rightarrow x+y=0,05$ (1)
$\overline{M}=8,8.2=17,6$
$\Rightarrow 2x+28y=17,6.0,05=0,88$ (2)
(1)(2)$\Rightarrow x=0,02; y=0,03$
Bảo toàn e: $2n_{Mg}=2n_{H_2}+10n_{N_2}$
$\Rightarrow n_{Mg}=0,17 mol$
$m=0,17.24=4,08g$