Convert the mass into moles (use the formula n=m/Mr)
m = mass and Mr = Molecular weights
Molecular weights are 32(Oxygen), 2(Hydrogen), and 16(Methane), respectively.
Since the masses are equal, you can take the mass as x. So, the number of moles would be:
n(O2) = x/32
n(H2) = x/2
n(CH4) = x/16
The ratio of their volumes is (O2) : (H2) : (CH4) = 1 : 16 : 2