The grandfather is wrong to punish both children, in my opinion.
But, I wonder if B is actually a bit more than “cheeky”. Most children I know to whom that description is attached are actually rude, often over-indulged and a few downright unpleasant. But their parents can’t see it- they are “cheeky”, “spirited” etc. If unchecked, I think some of these children will be those “tell it like it is”, “just saying!” people who are actually mostly rude, conceited and unable to see they might not be correct in any given situation. But assume their “humour” and “honesty/ forthrightness” allow them to say anything they like without consequence.
Perhaps your friend needs to think about what the situation actually is: 1)grandfather completely over-reacted to something which wasn’t rude at all; 2) whether he was rightly insulted by something but over-reacted;3) B was rude and withdrawal if treat for her would be fair enough (but unfair to A); 4) whether this is a reaction to a more sustained pattern of behaviour from B, which he’s had enough of? Still not right to punish A.
I think the fact that the child’s parents sat “ opened mouthed” (so presumably realised this was rude?) and let her do it 3 times before she was told off by her grandfather leads me to think it is 2,3 or 4.
I’m also not of the opinion that withdrawing a treat for bad behaviour is “strings attached”. It’s consequence for bad behaviour. If my DC’s are rude, I might withdraw a treat or fine some pocket money etc. I would be fine with a grandparent or aunt withdrawing a treat if one of the DC has been rude to them. Treats are not “unconditional” and can be removed where behaviour does not warrant it. It’s not controlling or unfair. It’s action = consequence. Though should be proportional to degree of transgression.
I don’t think this is school fees or something of that magnitude from OP’s description that the parents will do something similar, but smaller, for A.