If you notice the image

there are only three stresses that are used i.e.:
- the normal to the surface $\sigma_{xx}$ and
- the shear stresses $\sigma_{xy}$ and $\sigma_{xz}$.
Reminder on the notation.
A stress denoted as $\sigma_{ik}$ is applied on a surface that is normal to the axis $i$, and the direction of the stress is parallel to axis $k$
I assume (the image is placed out of context), that this derivation is to determine either the neutral axis or something relating to the deflection stresses/displacement equation. As such this calculation pertains only to the cross-section at hand. So the internal reactions (namely the moments in this case) are calculated only on the cross-section surface. Therefore, the only stresses that are relevant are the stresses which are applied on the cross-section (see above).
sign
Finally, regarding the sign, I recently wrote the following answer which I am replicating in part here. Note that in the place of a Force you can put a stress times the area that it is applied.
When a force is multiplied by a distace to generate the moment the sign is depended on both the signs of the distance and the force. In the 2D case of the xy plane (forces are only on that plane), the moments of a force are given by the following equation (notice the minus) :
$$M_z = -F_x\cdot y + F_y\cdot x$$
So for horizontal forces:
|
Positive y |
Negative y |
| Positive $F_x$ |
- M |
[![enter image description here][2]][2] +M |
| Negative $F_x$ |
[![enter image description here][3]][3] +M |
[![enter image description here][4]][4] -M |
Similarly, vertical forces:
|
Positive x |
Negative x |
| Positive $F_y$ |
[![enter image description here][5]][5] + M |
[![enter image description here][6]][6] -M |
| Negative $F_y$ |
[![enter image description here][7]][7] -M |
[![enter image description here][8]][8] + M |
In the generic case 3D case the equation is more easily derived by the determinant form
$$\vec{M} = \left|\begin{matrix}\vec{i} &\vec{j} &\vec{k}\\
x & y & z\\
F_x & F_y&F_z
\end{matrix}\right|= \vec{i}(y\cdot F_z - z\cdot F_y) + \vec{j}(z\cdot F_x - x\cdot F_z) + \vec{k}(x\cdot F_y - y\cdot F_x)$$
So when you are calculating on the yz plane, then the moment would be:
$$\vec{M}_x = \vec{i}(y\cdot F_z - z\cdot F_y) $$
additionally for the $M_z$
$$\vec{M}_z = \vec{k}(x\cdot F_y - y\cdot F_x)$$
however because $x=0$ (on the plane of the cross-section this devolves to:
$$\vec{M}_z = - y\cdot F_x\cdot \vec{k}$$