They’re both a couple of duds.
Rawls purported to analyze the concept of justice, but he confused justice with equality.
His ‘analysis of justice’ is given by the proposition that a society is unjust if that society’s losers feel that they do not have power over that society’s winners. Consequently, a society is just, in Rawls’ view, if everybody in it is such a total loser that nobody envies anybody.
As for Foucault, his work seems to be a fairly standard Marx-reboot, laced with some poorly understood Freud, and deriving its appeal not from its merit but from its message that losers are losers not because they are losers but because they are oppressed.
So they have similar, and similarly broken, messages.
Not very much going on with either of these ‘philosophers.’
They both advocated Pol Potism, the only difference being that Rawls’s starting point was social contractarianism, whereas Foucault’s starting point was Marxism.
But they ended up in the same wrong and dumb place.
Plus, their work is prohibitively boring.