Answer
In arrangement (a), the force is greater.
Work Step by Step
In both cases, the acceleration of the boxes is similar, which is $$a=\frac{P}{m_1+m_2}$$
1) Case a):
To move with acceleration $a$, box 2 requires a force $F_{12}$ applied to it from box 1. According to Newton's 2nd law, we build a relationship between $F_{12}$ and $a$ $$F_{12}=m_2a$$
2) Case b):
Similarly, to move with acceleration $a$, box 1 requires a force $F_{21}$ applied to it from box 2. According to Newton's 2nd law, we again have $$F_{21}=m_1a$$
Since $m_2\gt m_1$, it follows that $F_{12}\gt F_{21}$, meaning in arrangement (a), the force is greater.