They show that the work of the law is written on their hearts, while their conscience also bears witness, and their conflicting thoughts accuse or even excuse them
Even though you and I have both using the same Protestant ESV translation, I will admit that this would be better translated as the NIV has it.
“They show that the
requirements of the law are written on their hearts, their consciences also bearing witness, and their thoughts sometimes accusing them and at other times even defending them.)”
Romans 2:15 NIV
Even so, the works of the Gentiles Saint Paul is referring to are not ‘works of the law’ as in Jewish works of the law, but requirements of the moral law; hence in verses 7-10:
“To those who by persistence in
doing good seek glory, honor and immortality, he will give eternal life. But for those who are self-seeking and who reject the truth and
follow evil, there will be wrath and anger. There will be trouble and distress for every human being who does evil: first for the
Jew, then for the
Gentile;but glory, honor and peace for everyone who does good: first for the
Jew, then for the
Gentile.”
Romans 2:7-10
That is why Saint Paul can say about both Jew and Gentile:
“For it is not those who hear the law who are righteous in God’s sight, but it is those who obey the law who will be declared righteous.”
Romans 2:13
Obey what ‘law’? Works of the Jewish Law? No, works of the moral law.