The non-replaceable batteries are more a function of being smaller and smaller. With quick charge, it's less necessary the first few years, and it's actually not too hard to replace the batteries with the right tools, or going to a shop.
As for the upgradable storage, that was more a function of the OS than anything else. Memory cards were originally mass storage devices running variants of FAT. While convenient, this caused a lot of problems - the Android security model requires processes not writing to each other's data or reading it (otherwise your games can steal credentials from your online banking, for example).
When running FAT on the memory card, any app with SD permissions could read all the files (a very bad thing), and it led to some real problems (such as very bad things being possible for users of LoJack, which included many Samsung Phones by preload. Disconnecting the mass storage would break apps that required the files on the card.
Addressing these issues first required the use of something like MTP (which uses a daemon and doesn't require exclusive access to the SD card). This makes it possible to write and read without breaking apps. Next, the card needed to be encrypted in order to protect the user data - otherwise, anyone who steals the phone can extract all the data on it. Locked boot loaders are designed to wipe the device when being unlocked for the first time, so that stolen devices aren't easily hacked.
Finally, cards needed to get fast enough to be functional as internal storage. Android marshmallow added support for external storage being treated as internal once those requirements could be met (accessible, secure, fast enough), and now we have phones that have external storage again. Apple does their own thing, but on the android side, it was more technical reasons than anything else for the lack of upgradable storage. It caused a lot of problems and took up space, so companies removed them.
You can see this with the Moto X. The X2 (second edition) took SD cards out. The pure edition added them back, using the same tray as the SIM card. Samsung's S5 had removeable batteries and external storage. The S6 took those out (for size and technical reasons). The S7 added the card back, but added quick charge instead of a removable battery, because the technical issues for the SD card have been addressed, but the size constraints stay.
Apple, on the other hand, wants to charge a bundle for more storage. They are control freaks, too, but the embedded encryption make external flash storage a viable option for them without losing that control. They may relax this requirement at some point - they finally made RAW photos an option in IOS 10, coming off external SD card. All data from an SD card has to be imported in their own app - it can't be read directly by other apps.