DNS A-records require that an IP address be hard-coded into your application’s DNS configuration
...which Heroku recommends avoiding. Heroku
NOTE: I have not tried this with Heroku app. I am still sharing this solution here as this is the first stackoverflow page that shows up for 'redirection from naked domain to www version' search. It may help others who are looking for an answer to generic redirection.
I have successfully redirected naked domain to www version. In addition, I also redirected the HTTP version to HTTPS version using google domains DNS settings in synthetic records.
Detail steps are documented here: https://www.am22tech.com/redirect-naked-domain-www-http-https-google-domains/