Step 1: Internal energy formula.
For an ideal gas with $f$ degrees of freedom, the internal energy of $n$ moles at temperature $T$ is \[ U = \frac{f}{2}nRT. \]
Step 2: Energy of the hydrogen.
Hydrogen is diatomic, $f_1 = 5$, at temperature $T$: \[ U_1 = \frac{5}{2}n_1RT. \]
Step 3: Energy of the helium.
Helium is monatomic, $f_2 = 3$, at temperature $2T$: \[ U_2 = \frac{3}{2}n_2R(2T) = 3n_2RT. \]
Step 4: Equate the energies.
\[ \frac{5}{2}n_1RT = 3n_2RT. \]
Step 5: Cancel $RT$.
\[ \frac{5}{2}n_1 = 3n_2. \]
Step 6: Form the ratio.
\[ \frac{n_1}{n_2} = \frac{3\times2}{5} = \frac{6}{5}, \] so $n_1 : n_2 = 6 : 5$, option (B). \[ \boxed{n_1 : n_2 = 6 : 5} \]