There are two nonlinear elements here, which act independently one after another.
The first one is the nonlinear MZI, where the phase in one arm is varied by changing the pump power P_2. The cross-phase interaction (in a medium having cubic nonlinearity) is responsible for this functionality. To deflect the beam at the MZI output this is enough.
However, the authors wanted not only to deflect the beam, but also to prevent the ubiquitous diffraction spreading through leveraging the second nonlinear medium, placed right at the MZI output. By proper choice of the signal power, one can attain balance between the self-focusing nonlinear phenomenon and diffraction, so that they would balance each other and diffraction would be beaten.
In my view, the task is better to split into three stages. In the fist stage you model the phase, accrued in the course of the cross-phase interaction. Then, you solve for the field profile at the second Y-combiner, which is dependent on the phase difference found earlier. After that, given the field profile found, you propagate it in the second nonlinear medium.