The force acting on each block is gravitational force given as,
[tex]F=mg[/tex]
The torque acting due to first block is,
[tex]\tau_1=\hat{l_1i}\times mg(-\hat{j})[/tex]
This can be solved as,
[tex]\tau_1=l_1mg(-\hat{k})[/tex]
The torque acting due to second block is,
[tex]\tau_2=\hat{l_2i}\times mg(-\hat{j})[/tex]
This can also be solved as,
[tex]\tau_2=l_2mg(-\hat{k})[/tex]
Therefore, the net torque acting on system is,
[tex]_{}\tau=\tau_1-\tau_2[/tex]
Substituting values,
[tex]\begin{gathered} \tau=l_1mg(-\hat{k})-l_1mg(-\hat{k}) \\ =mg(l_2-l_1)\hat{k} \end{gathered}[/tex]
Thus, the net torque acting on system is
[tex]\tau=mg(l_2-l_1)\hat{k}_{}_{}[/tex]