I found this problem in The Theory of Groups by Marshall Hall.
Let the group $G$ be of order $p^rq^s$. If $G$ has two composition series $1 \unlhd A_1 \unlhd A_2 \unlhd \cdots \unlhd A_r \unlhd A_{r+1} \unlhd \cdots \unlhd A_{r+s} =G$ and $1 \unlhd B_1 \unlhd B_2 \unlhd \cdots \unlhd B_s \unlhd B_{s+1} \unlhd \cdots \unlhd B_{r+s} =G$, where $|A_r| = p^r$ and $|B_s| = q^s$, show that $G$ is a direct product of $A_r$ and $B_s$.
So essentially, $G$ is direct product of its Sylow subgroups, so $G$ is nilpotent. My thought is to show that $A_r$ and $B_s$ are normal in $G$. I can't seem to do so though for some reason. Clearly, $A_r$ is normal in a subgroup of order $p^rq$, which is $A_{r+1}$. Does that imply it's normal in $A_{r+2}$, which has order $p^rq^2$? My thought was to use induction and then show it's normal in $G$, but it doesn't seem to be working or I am missing something?
Hints: If $p=q$ the result follows.
First think about Jordan-Hölder and what it implies with these two $\textbf{composition}$ series, keep in mind that either $q<p$ or $p<q$.
Without loss of generalization suppose that $p>q$, now think about the last conclusion and what happens between $A_{r}$ and $A_{r+1}$, now think about it for $A_{r+i}$ with $i \in [1,2,...,s]$.
After that think about the size of $A_{r}B_{s}$ and how it relates to $G$. And then ensure the direct product.
And I think it should be it.
Good Luck!