Getting list of top 10 users and sort on last name

You are arranging the users within foreach block. Why don’t you arrange them first and then go with the loop for displaying info. If you do that, you will need only one query.

Do this in this order-
1. Do the query with get_users. You can add an extra parameter who=author. This will force to search only the authors. I believe the response will be better. This will return an array of WP_user Object.
2. Use a foreach loop to clean lastname
3. Sort the array of object based on their lastname. You can use usort() for this
4. At last, use another foreach for displaying everything.