For the case where $G, H$ can be infinite:
Consider $H< H
$\Rightarrow [G_x:H_x][G: G_x] = [H:H_x][G:H]$. Since $[G: G_x]=[H: H_x] = |X|$, we're done.
Note: Can I assume $[G: G_x]=[H: H_x]$ even if $X$ is not finite?
For the case where $G, H$ can be infinite:
Consider $H< H
$\Rightarrow [G_x:H_x][G: G_x] = [H:H_x][G:H]$. Since $[G: G_x]=[H: H_x] = |X|$, we're done.
Note: Can I assume $[G: G_x]=[H: H_x]$ even if $X$ is not finite?