As M1>M2, so tension in thread connecting the block B and support C is (M1−M2)g. When this thread is burnt, this tension disappears. In this case tension in spring is M1g and it is elongated.
So, tension in stringconnecting A and B is M1g. Hence, resultant force on A remains zero because tension in string is balanced by tension in spring. The block B has a net upward force (M1−M2)g.
so initial acceleration of block B is M2(M1−M2)g
Thus, initial acceleration of M1 is zero and that of M2 is M2(M1−M2)g upward.