For example, "their salaries are higher than mine". Is this sentence grammatically correct? Or we have to say "each of their salaries is higher than mine"?
No need to make English harder than it is already. There is no rule prohibiting comparing groups of things with individual things.
There are some cases where comparing a group to an individual can create an ambiguous statement: those five people have more money than I do. Does this mean that each of the five people has more money than I do, or that the sum of the five people's money is greater than the amount of money I have? There's no way to tell without more context.
We could remove the ambiguity by using a form like the one you suggested at the end of the question: each of those five people has more money than I do. This is not any more grammatical (because the first was perfectly grammatical), but it is less ambiguous.