They got $25 in beer and $3 in cash, for a total of $28. That's what the men walked away with--$28 in cash and goods. They should have walked out with $30, but the kid stole $2 from them. How that theft was distributed among the men is irrelevant.
To look at it another way, imagine that instead of $30 ($10 pp) they paid $27 ($9pp). Then the kid hands them the beer and send them away, stealing their $2 in change. Those numbers make perfect sense. This is exactly the same, except in your scenario, they initially overpaid by $5 instead of by $2 ($30/$27) then got $3 back before the kid stole $2.