According to the inequalities in the picture and your definitions, the system is the cycle engine. Heat flows from hot bath to the system, thus it is positive, heat flows out of the system to cold bath thus it is negative, work is done by the system on surrounding thus it is negative.
The arrows in the picture correctly describe energy flow and next to them is value of the energy transferred in the direction of the arrows. Since $q_2$ and $w$ are defined to flow into the system, i.e. against the drawn arrows, energy transferred in the direction of the arrows will be with minus sign.
To expand on the arrows:
The $q_2$ is defined to be heat that flows into the engine from cold bath. Because heat in fact flows the other way around, it is negative. This is given before you even draw the picture.
The problem now is only to understand why there is $-q_2$ in the picture. The quantity next to the arrow from engine into cold bath is supposed to give you the heat that flows from the system into the bath. But this is not $q_2$, because $q_2$ flows the other way around (into the system) and therefore the quantity next to the arrow is $-q_2$. Because the heat indeed flows into the cold bath in direction of the arrow, the heat in the picture next to the arrow is supposed to be positive. And this is consistent with our original claim that $q_2<0$