When the battery is suddenly disconnected, a current is induced in loop B due to a sudden change in the flux through it. It is only induced for a moment when the current suddenly falls to zero. There is no induced current after it has fallen to zero. According to Lenz's law, the induced current is such that it increases the decreasing magnetic field. So, if the current in loop A is in clockwise direction, the induced current in loop B will also be in clockwise direction. Hence, the two loops will attract each other.