When protons and neutrons interact attractively and coalesce to form an atomic nucleus, their energy in this state must be less than what it was when they are separated, so they lose mass which is then converted into energy by $E=mc^2$. Now, when electrons interact attractively with an atomic nucleus and orbit it under act of electrostatic forces, their energy in this state must be also less than what it was when they were free. So what this energy difference between the two electron states could come from? They will lose mass also?
And if they lose mass, how they could when they are, unlike protons and neutrons, are not composed from intraparticles, so they cannot convert their intraparticles total potential energy into binding energy.