I purchased the Google Pixel 5a 5G for its published battery life, which in my case, is amazing, but the Google Pixel 6a battery is meh.
The support for the Pixel 5a is limited to something like 2025, but the support for the 6a extends to 2027. In either case, you'd probably have purchased a newer phone by that time, so I didn't let that scare me off the Pixel 5a. Consider, too, that the Pixel 4XL is still widely available. I purchased the 6a to give it a try, but the battery life is noticeably worse than the Pixel 5a.