The key is to notice that an arbitrary box $B$ aligned with the x-y-z axes in space has the property that one of its dimensions is rational if and only if there exists an integer $q$ such that $$\int\int\int_B \sin(2\pi qx)\sin(2\pi qy)\sin(2\pi qz)dxdydz=0\tag{1}$$
This equivalence is not difficult to prove. Indeed, if $B$ has one side of rational length $\frac p q$ (say, along the $x$ axis), then that triple integral is the product of three integrals. One of these integrals is $$\int_0^{\frac p q}\sin(2\pi qx)dx=0$$
Conversely, suppose the triple integral is $0$, then at least one of the single integrals that forms its product must be $0$. Assume it's true for the one along the $x$ axis. This implies that the domain is integration must be an interval whose length is a multiple of the period of $\sin(2\pi qx)$, so it's a rational number.
With that equivalence proven, Let $B$ be the large box, and $\{B_i\}_{1\leq i \leq n}$ be the small boxes.
So all we have to do is to show that $B$ satisfies property $(1)$ for some integer $q$.
We know that each box $B_i$ has at least one dimension that's a rational number $\frac {p_i}{q_i}$.
Let $$q=\prod_{1\leq i \leq n}q_i$$ We can prove that property $(1)$ holds for that value of $q$.
The triple integral over $B$ can be decomposed as the sum of integrals over the small boxes
$$\int\int\int_B \sin(2\pi qx)\sin(2\pi qy)\sin(2\pi qz)dxdydz=\sum_i
\int\int\int_{B_i} \sin(2\pi qx)\sin(2\pi qy)\sin(2\pi qz)dxdydz$$
Since property $(1)$ is true with $q$ for each small box, each integral in the sum is $0$. This implies the integral over $B$ is also $0$, which implies the desired property.