There's the term world's smallest violin, which is used to express mock sympathy.
In conversation, it's often accompanied by a hand gesture, as if someone is playing a miniature violin. For example, to that "A" student complaining about his B on the math test, I could say something like:
Aw, that's a shame. Here's the world's smallest violin, playing I Feel Sorry for You.
The website TV Tropes says this about the gesture:
A predominantly Western gesture, the World's Smallest Violin is given to a person who is exaggerating the sorrow of his/her predicament in order to gain sympathy; the person who does the giving presumably has none.
Wikipedia mentions it under a list of hand gestures; the page there reads:
World's Smallest Violin (also called "How Sad" or "World's Smallest Violin Playing Hearts and Flowers") is made by rubbing the thumb and forefinger together, to imitate bowing a violin. This gesture is used to express sarcasm and lack of sympathy, in response to someone exaggerating a sad story or unfair treatment.
Another (more brief) way to express such mock sympathy would be:
Oh, “Woe is me!”
I put the quotation marks in that sarcastic remark, because if I said “Woe is me!” in that vein to the B student, I would be putting those words into the student's mouth.