i have created an issue about this on the tracker, MDL-20471 , and posted the patch there.
Hope you like.
General developer forum
Why users are not removed from groups in role unassign in category level ?
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.