Everyone is equal in the eyes of Allah, means that everyone has an equal opportunity to reach God and attain his satisfaction. Everyone is tested by God, the prophets are tested and the normal people are tested.
In fact the test of the prophets and Imams are more severe and more difficult than the test of normal people.
The reason they were chosen as Prophets and Imams is because God knows through His knowledge (which is not limited by time) that these prophets and Imams are the greatest and most obedient of Gods creation. We are limited by time and place so we know who the victor of a test is after the test results come out. Allah created time and place so Allah knows who the victor is even before the test.
The reason the Prophet and Imams are greater is because of the knowledge they have. They have been given the knowledge by God because they accepted the knowledge. We all have access to signs of God and knowledge but we look past these signs most of the time. The prophets and Imams have knowledge, however they are also tested based on their knowledge, that is why their tests are more severe.
God tested the souls in a previous realm, and tests is again to show us and prove to us on the day of Judgement our own actions. Although He knows who goes to heaven or hell, our actions will be displayed in front of us so no one questions the Justice of God.
Just because we don’t remember the test doesn’t mean we were not tested. We forget a lot of things in this life, it doesn’t mean that didn’t happen. Also, the test in the previous realm was a simple test not something as extensive as in this life.