The primary point of this parable of the two sons is about having a change in heart, not just about saying or doing the right things. The following stories might illustrate this point.
Once there were two couples. Couple A were married in a large, beautiful church ceremony. They pledge life-long faithfulness and love to each other in the moving words of their vows. However, their life together has been one of abuse both physical and verbal. They both have been unfaithful to each other.
Couple B live together. They had no public ceremony. They signed no marriage license. They spoke no vows in the presence of witnesses. However, their life together is a loving and affirming relationship. They have remained faithful to each other.
Which couple would you say is doing the will of God?
Both need change of hearts - couple A in the way they act towards each other and couple B in their attitudes about the importance of the words in a public ceremony.
Another analogy might be with those who attend church and say all the right words, but whose lives fall somewhat short of John's "way of righteousness" and others who live exemplary lives; but who want nothing to do with "organized religion" and the public expression of their faith.
Both need "a change of heart".