Let mass A move with acceleration 'b' and mass B move with acceleration 'a'.
directions of 'a' and 'b' are different but magnitude of 'a' and 'b' are same.
Since the length of the rope AB is same
$a \cos 45=b \cos 45$
Also $T \sin 45=mb$------(1) for A
$mg-T\sin 45=ma$-----(2) for B
$2 ma =mg=>a=g/2$
Substituting in (1)
Hence b is the correct answer.