How do I show that if a monic polynomial $f(x) \in \mathbb{Z}[x]$ has reductions modulo two prime numbers $p, q$ such that $f(x) \;(\text{mod} \; p)$ is a product of two irreducible factors of degrees $d_{1p}$ ,$d_{2p}$ and $f(x) \;(\text{mod} \; q)$ is a product of two irreducible factors of degrees $d_{1q}$ ,$d_{2q}$ and $\{d_{1p}$ ,$d_{2p}\} \neq \{d_{1q}$ ,$d_{2q}\}$ then $f(x)$ is irreducible in $\mathbb{Q}$.
I tried to prove the contrapositive statement, but I did not get anything good.
Suppose that $f$ is not irreducible, and write $f=gh$. By Gauss lemma, we can suppose that $g,h$ are monic and have integer coefficients. Let $a= \deg g$ and $b= \deg h$. Then $$f= gh \mod{p}$$ and $$f= gh \mod{q}$$ so that $$\{ d_{1p}, d_{2p}\} = \{ a,b \} = \{ d_{1q} ,d_{2q}\}$$ a contradiction.