schadenfreude is when you get more and more happy, as someone fails more and more.
compassion is when you see that someone fails, you feel into what it's like to fail like that, so your mind comes up with a fitting duality, meaning you imagine how much better he could feel, if he would not fail and perhaps what that would look like and you have so much love for that imagination that you take the time to figure out how the other person could make it real, you teach the other person about your ideas and in return you may have just invented another way to that attractive place of your imagination, a way that may also work for yourself one day, when you are in his situation. you are lending and training your problem solving capabilities.
look, egocentricity is an illusion to begin with, therefore it is meaningless to point out how doing something for the ego of another person is an illusion, as the ego of the other person is only as much of an illusion as yours, not more or less. you are doing nothing for your self, all you do is for the maintenance evolution of your subject. if you are doing something for someone else, you are still working for the same boss, nature, evolution. too bad, you suck at that job. (not meant as an offence at a particular person, just my general sense of black humor)