J.C.
Is this friend about the same age? It sounds to me that this girl has low self esteem and is 'one-uping' to make herself feel better. This is very common in children, and it really isn't about competition, it is rooted in self-esteem and jealousy. I know that the urge to correct when the friend makes these comments is strong and natural but it will not change the behavior because it is negative. Instead try turning it into a positive and teaching moment. Ie when she said the thing about your daughter's score, say something like 'a good friend is happy for their friends and asks for their help to get a good score too so they can be equal and have more fun.' Also, since you are close with her parents I would bring up with them that you have noticed that she seems to be feeling unsure of herself and is making demeaning comments to others to make herself feel better. The parents may have noticed this too and are working on it, and may enlist your help too. Remember it takes a village to raise a child!