Please explain the Hadith that says: “Treat people according to grades.” It seems to suggest that inequality is acceptable.
The Hadith does not speak of grades. It speaks of treating people in the way that is due to them. You thus do not address your teacher at university in the same way as you address a fellow student. The respect you show to your teacher is due to him or her because of their status. It does not mean that your friends and colleagues are of a lesser degree; they are in a different position. This applies at all levels and in all situations.
All people are equal in as far as their status before God is concerned, but they have different positions in the social order, which should be respected. May I also point out that the translation of the Hadith is rather inaccurate. I would translate it as: “Assign to people what is due to them.” This reflects the sense of the Hadith better.