In perfectly elastic collison there is mutual exchange of kinetic energies between colliding bodies. So yoiu cannot apply conservation of Enegy for individual masses.
This is due to the fact that when you consider individual masses, only that individual mass becomes your system. So the force applied by the other object during collision becomes EXTERNAL force. As work is done by external force, it changes both Kinetic Enegry as well as momentum. So you can't apply these laws for individual masses.
However, when you consider system of two collisding masses, these laws are valid because same momentum change occurs for both bodies in opposite direction thereby cancelling each other.
Hope u got it..............