Figure shows the various forces acting on blocks m1, m2 and M.
for block m1, Tension is balanced by weight of m1. This Tension T = m1g = 98N is pulling the block M.
Since m2 block is pressing M block, Reaction force at the contact surface of M is (M+m2)g .
Hence limiting friction force f = μN = 0.4×30×9.8 = 117.6 N which is greater than the pulling force 98 N.
Hence there is no movement block M and m1.acceleration of m1 is zero
Since the block m2 is pressing block M on the inclined surface, component of weight also acting against pulling force (Tension in the string).
Hence as shown in figure net pulling force along the horizontal direction is (m1g - m2gcos245) = [98 - (98/2)] = 49 N.
Since friction prevents the movement of block-M, friction force acting towards right at the contact surface of block-M is 49N