$a_0-a$ , here $a$ means the acceleration of two blocks with respect to the pulley. Hence, if $a$ > $a_0$ then also this relation perfectly works. They are assuming $m_2$ to be accelerating upwards because they have preasumed that $m_3$>$m_2$. A very simple way to assume this is that suppose the whole system was at rest. Then the mass $m_2$ would move upwards and mass $m_3$ would move downwards with respect to the ground frame. Now in the present state pully B and both the masses are accelerating downwards with respect to the ground. But we still want to find the only downwards acceleration of both the masses with respect to the ground then for heavier mass acceleration is $a_0$ + $a$ and for the smaller mass is $a_0$ - $a$