You aren't seeing that this is another situation. Job has just spoken of all that He has done to keep himself "pure". As if a mans works can ever equal the pure Holy Father and His goodness.
Its my belief that Job was of the first or at least a previous age. That our present time period is the recreation from Jobs age.
We know from scripture that in the mind of Father, that His sacrifice offered of His only Son was from the foundation of the world. Is the wording. So would they have this knowledge too? We don't know. But, there is a fall, but not of men. The 1/3 of angels with Lucifer fell from Heaven in this time period.
So righteousness as we understand it. Imputed to us. Perhaps Elihu knew, but Job was depending on his own. Who knows? Just ruminating, same as all here.
Theres lots of missing info from Job.