Pick a convenient equal mass and compute moles directly instead of working with ratios symbolically.
Let the equal mass of each gas be 32 g, chosen because it divides evenly by all three molar masses.
Moles of $O_2$ = $32/32 = 1$ mol.
Moles of $H_2$ = $32/2 = 16$ mol.
Moles of $CH_4$ = $32/16 = 2$ mol.
At the same temperature and pressure, volume is proportional to moles, from $PV = nRT$, so the volumes are in the ratio $1 : 16 : 2$ for $O_2 : H_2 : CH_4$.