Non-editing teacher setting up groups: yes. I think you just need to give them the moodle/course:managegroups capability.
Teachers creating new user accounts. This is impossible.
To understand why, you have to realise that a user is only a teacher within a particular course. Users are created across the whole system. Therefore, having a role within a course can never let you create user accounts.
What you can do is to create a new role 'User creator', or something like that. Give that role the capabilities necessary to create new user accounts. Then give that role to people you trust on the 'Assign system roles' page.