Greetings Ahmad.
What if we also look at "rich and poor" from the angle of this life first?
Here is what GOD says about it:
[Qoran 89:15] When the human being is tested by his Lord, through blessings and joy, he says, "My Lord is generous towards me."
[Qoran 89:16] But if He tests him through reduction in provisions, he says, "My Lord is humiliating me!"
GOD is trying us in this life through His provision. " Rich or poor" we are here to take that test.
Also our situation can change from "poor to rich" and vice versa! Are you going to stay loyal to god or are we going to become proud, arrogant when we are rich or blame Him/depend on others when we are poor?
[Qoran 30:36] When we bestow mercy upon the people, they rejoice therein. But when adversity befalls them, as a consequence of their own works, they become despondent.
[Qoran 39:49] If the human is touched by adversity, he implores us, but as soon as we bestow a blessing upon him, he says, "I attained this because of my cleverness!" Indeed, this is only a test, but most of them do not know.
GOD gives or takes away according to His knowledge. He will bring out our true conviction through whatever He gives us.
On the day of judgement, we will not have any excuses?
Having said that, I can also see children, others (frail,ill,..) that suffer through what others do. God is just , He will judge according to His knowledge. He may also save some to try them later in the future? Then on the day of judgement there is total justice for each individual.
Can we realise that our trial is continuous and remain loyal/faithful to GOD in this life?
Just another angle to consider.
GOD bless you.
Peace.