You can translate this in an active form. "Hearts" here is a metonym for the entire person. AT: "what God requires them to do has clearly been shown to them, in their minds, soul and will" or "God has written on their hearts what the law requires them to do" or "God has shown them what the law requires" (See: [[rc://en/ta/man/translate/figs-activepassive]] and [[rc://en/ta/man/translate/figs-metonomy]])
Here "bears witness" refers to the knowledge they gain from the law that God has written in their hearts. AT: "tells them if they are disobeying or obeying God's law" (See: [[rc://en/ta/man/translate/figs-idiom]])