Answer
See the detailed answer below.
Work Step by Step
First of all, we need to find the escape velocity from the earth's surface.
We can use the conservation of energy principle,
$$K_i+U_{gi}=K_f+U_{gf}$$
$$\frac{1}{2}mv_i^2+\dfrac{-GmM_E}{R_E}=\frac{1}{2}mv_f^2+\dfrac{-GmM_E}{R_E+h}$$
where $v_i=v_{\rm esc}$, and we need the final position to be infinity at which the final velocity is zero.
Hence,
$$\frac{1}{2}mv_{\rm esc}^2-\dfrac{GmM_E}{R_E}=\frac{1}{2}m(0)^2-\dfrac{GmM_E}{R_E+\infty}$$
$$\frac{1}{2}\color{red}{\bf\not} mv_{\rm esc}^2-\dfrac{G\color{red}{\bf\not} mM_E}{R_E}=0$$
Hence,
$$v_{\rm esc}=\sqrt{\dfrac{2GM_E}{R_E}} \tag 1$$
----
a) Now we need to find the temperature of the gas nitrogen at which the rms speed of its molecules is equal to $v_{\rm esc}$.
We know that the rms speed is given by
$$v_{\rm rms}=\sqrt{\dfrac{3k_BT_{N_2}}{M_{N_2}}}$$
Plugging from (1); since both speeds are equal,
$$\sqrt{\dfrac{2GM_E}{R_E}}=\sqrt{\dfrac{3k_BT_{N_2}}{M_{N_2}}}$$
$$ \dfrac{2GM_E}{R_E} = \dfrac{3k_BT_{N_2}}{2M_{N}} $$
Thus,
$$T_{N_2}=\dfrac{4GM_EM_N}{3k_BR_E}$$
Plugging the known;
$$T_{N_2}=\dfrac{4(6.67\times 10^{-11})(5.98\times 10^{24})(14\times 1.661\times 10^{-27})}{3(1.38\times 10^{-23})(6.37\times 10^6) }$$
$$T_{N_2}=\color{red}{\bf1.41\times 10^5}\;\rm K$$
____________________________________________________________
b) By the same approach, in the hydrogen gas,
$$T_{H_2}=\dfrac{4GM_EM_H}{3k_BR_E}$$
Plugging the known;
$$T_{H_2}=\dfrac{4(6.67\times 10^{-11})(5.98\times 10^{24})(1\times 1.661\times 10^{-27})}{3(1.38\times 10^{-23})(6.37\times 10^6) }$$
$$T_{H_2}=\color{red}{\bf1.005\times 10^4}\;\rm K$$
____________________________________________________________
c)
We need to find the average translational kinetic energy per molecule for both gases.
The average translational kinetic energy of a molecule in the Earth's atmosphere is given by
$$K_{avg}=\frac{3}{2}k_BT$$
where $T$ here is the Earth's atmospheric temperature which is considered as 20$^\circ $C
and the kinetic energy needed to escape is given by
$$K_{esc}=\frac{1}{2}Mv_{\rm esc}^2$$
where $M$ is the mass of one molecule of the gas.
Hence,
$$\dfrac{K_{avg}}{K_{esc}}=\dfrac{\frac{3}{2}k_BT}{\frac{1}{2}Mv_{\rm esc}^2}$$
$$\dfrac{K_{avg}}{K_{esc}}=\dfrac{3k_BT}{ Mv_{\rm esc}^2}$$
Plugging from (1);
\dfrac{2GM_E}{R_E}
$$\dfrac{K_{avg}}{K_{esc}}=\dfrac{3k_BTR_E}{ M (2GM_E)}$$
Plugging the known for the nitrogen case,
$$\dfrac{(K_{avg})_{N_2}}{(K_{esc})_{N_2}}=\dfrac{3(1.38\times 10^{-23})(20+273)(6.37\times 10^6)}{ 2(14\times 1.661\times 10^{-27})(2\times 6.67\times 10^{-11})(5.98\times 10^{24})} $$
Hence,
$$\dfrac{(K_{avg})_{N_2}}{(K_{esc})_{N_2}}= {\bf 0.0021}=\color{red}{\bf 0.2}\%$$
And according to this result, the earth saves the nitrogen oxygen easily.
And by the same approach for the hydrogen gas,
$$\dfrac{(K_{avg})_{H_2}}{(K_{esc})_{H_2}}=\dfrac{3(1.38\times 10^{-23})(20+273)(6.37\times 10^6)}{ 2(1\times 1.661\times 10^{-27})(2\times 6.67\times 10^{-11})(5.98\times 10^{24})} $$
$$\dfrac{(K_{avg})_{H_2}}{(K_{esc})_{H_2}}=\bf 0.029=\color{red}{\bf2.9}\%$$
Hence, enough fraction of hydrogen molecules are moving at escape speed that allow hydrogen to escape from atmosphere to space.