Define $T$ as the group defined by your presentation. You want to show that indeed $T \cong G \times H$. Clearly you obtain a homomorphism $T \to G \times H$, which is surjective. Let $x$ be an element of the kernel (a word written in letters of $S_G$ and $S_H$), i.e. it gets mapped to the trivial element of $G \times H$. Using now the canonical projection map onto $G$ you see that the obtained (now only in letters of $S_G$) is trivial in $G$, so (this part of $x$) comes from relations of $R_G$ in $G$. Do the same with $H$. Since you can permute your letters of $x$ in $T$ you directly see that $x = 1$ also in $T$. So the kernel is trivial and hence the morphism is indeed an isomorphism.