Molecules of hydrogen escape the earth faster because their R.M.S. velocity is more than that of oxygen molecules. R.M.S. velocity is given by
where {{r}^{rms}} is the mass of the molecules.
Mass of oxygen molecules is larger than hydrogen so his R.M.S. velocity is less than that of hydrogen. Thus it escapes slower than hydrogen.