Kinetic friction on each block is μkmg: 0.2×20=4 N on the 2 kg block and 0.2×30=6 N on the 3 kg block. For the whole system, the string forces are internal:
a=m1+m2F−μk(m1+m2)g=525−10=3.0 m s−2
(a) Force on the 3 kg block. For the 2 kg block behind it: T−4=2×3, so T=10 N.
(b) Force on the 2 kg block. For the 3 kg block behind it: T−6=3×3, so T=15 N.
General result. Let mb be the mass of the block behind (pulled only by the string). Then T−μkmbg=mba, and with a=m1+m2F−μkg,
T=mb(a+μkg)=m1+m2Fmb
The μkg terms cancel, so the tension is 25×2/5=10 N or 25×3/5=15 N, exactly the same as on a smooth floor. Friction reduces the acceleration, but it takes away the same share of force from each block in proportion to its mass.