The refractive index of a medium is defined as the ratio of the speed of light in vacuum ($c$) to the speed of light in the medium ($v$).
That is, $$ n = \frac{c}{v} $$ Let $v_1$ and $v_2$ be the speeds of light in the two media with refractive indices $n_1$ and $n_2$ respectively.
Then, $$ n_1 = \frac{c}{v_1} \\ n_2 = \frac{c}{v_2} $$ We want to find the ratio $\frac{v_1}{v_2}$.
From the above equations, we can write $$ v_1 = \frac{c}{n_1} \\ v_2 = \frac{c}{n_2} $$
Then $$ \frac{v_1}{v_2} = \frac{\frac{c}{n_1}}{\frac{c}{n_2}} = \frac{c}{n_1} \cdot \frac{n_2}{c} = \frac{n_2}{n_1} $$
Thus, $\frac{v_1}{v_2} = \frac{n_2}{n_1}$.