Looks like my next phone will be a Motorola! I'm tired of "upgrading" phones every couple of years because the battery wears out.
You can replace the battery in virtually any phone, Apple included. Apple'll do it for you for a pretty nominal charge - $30-70 in most cases, and that includes the battery and labor. https://support.apple.com/iphone/repair/battery-power They're not made to be just popped in/out, sure, but it's entirely possible to get more years out of a phone this way. I'd be more concerned with software updates than battery.
Apple does seem to be doing a better job than most of the Android OEMs at ensuring longevity.