From $C$ to $B$ the time interval of travelling is same.
So, $v_{ av }=\frac{v_2+v_3}{2}=\frac{2+4}{2}=3 \,m / s$
Now, first half is covered with $6 \,ms ^{-1}$ and second half with $3 \,ms ^{-1}$. So when distances are same.
$v_{ av }=\frac{2 v_1 v_2}{v_1+v_2}=\frac{2 \times 6 \times 3}{6+3}=4 \,ms ^{-1}$
$v_{ av }=4 \,ms ^{-1}$