The other answers are correct in terms of the principal reason that lighter molecules are much more likely to escape the atmosphere. However, it seems that the premise of the question (and perhaps also of some of the answers and comments) is based on an incorrect model of atmospheric escape.
Molecules from most parts of the atmosphere would never escape regardless of velocity.
The picture below is taken from this document (recommended reading) and illustrates that escape is basically only possible for molecules above 500 km (the exosphere). Molecules below that will (most likely) collide with other molecules before escaping.
So, what is the atmospheric composition like in the exosphere?
The figure below shows the mixing ratios for the main components between 0 and 1000 km based on data taken from NRLMSISE-00. The exosphere is shaded in grey. As you can see, the most abundant molecules in the exosphere are atomic oxygen, helium and hydrogen. 473
Hence, it is kind of a moot point to discuss escape velocities of molecular hydrogen and oxygen. Of course, the mass ratio happens to be the same since they are both diatomic molecules (but note that a large part of the atomic hydrogen in the exosphere originated from water in the lower atmosphere rather than from molecular hydrogen).
It is also very hot in the exosphere (~1000 K) so making calculations for surface temperatures is also technically wrong (though again, it may happen to give the same qualitative result when comparing two species).
Yes, lighter molecules (or atoms) are much more likely to escape the atmosphere. The by far biggest reason for this is that they are much more likely to reach escape velocity (see the other answers). But another contributing factor is that they are much more likely to reach the upper layers of the atmosphere where they can escape because of gravitational stratification, which starts already in the heterosphere. However, most molecular species will be photolyzed into their atomic constituents by UV radiation before they reach altitudes high enough to escape, so it is really the mass of the atoms that matter. Another factor that is very important for which species reach the top of the atmosphere is of course chemical processes in the atmosphere, but that is a whole different chapter. 473