(a) The normal force on the 4 kg block is N=4×10=40 N. The hanging block's weight, 2×10=20 N, tries to pull the system. The most that static friction can resist is
μsN=0.4×40=16 N<20 N
so the blocks start to move. Once moving, kinetic friction acts on the 4 kg block, opposite to its motion:
fk=μkN=0.25×40=10 N

Both blocks have the same magnitude of acceleration a because the string is inextensible.
4 kg block (towards the pulley positive): T−10=4a
2 kg block (downward positive): 20−T=2a
Adding, 10=6a, so
a=610=1.67 m s−2
T=20−2a=20−3.33=16.7 N
Check: 16.7−10=6.7 N≈4×1.67. The tension is less than the hanging weight, as it must be, since the 2 kg block accelerates downward.
(b) On table B the largest static friction available is
μsN=0.6×40=24 N>20 N
so friction can hold the system, and the blocks stay at rest. With no acceleration, the hanging block gives T=20 N, and the 4 kg block gives fs=T=20 N, directed away from the pulley.
The friction is 20 N, not 24 N: static friction adjusts itself to the smallest value needed to prevent motion, and 24 N is only its upper limit.