At this point in Paul’s argument the way a person can secure a righteous standing before God has not yet been presented. The emphasis is on the justice of God’s judgment, leading to the conclusion that nobody on his own can be declared righteous by God. The answer to this question has been addressed by Paul, no one is righteous before God based on our works. No one, no not one (Romans 3:10).
Let us not confuse Romans 2 with Revelation 20: at the Judgment Day there will be no reasoning or preaching: only condemnation “according to their works—the things written in the books.” God’s great announcement of these principles of His Throne is here given to awaken us out of any false hopes about ourselves. Paul is laying a foundation that he will build upon in subsequent chapters. Having cut through the rituals, there is now no cover to hide behind.