It sounds more like an Apple Music problem than a hardware problem.
The thing about streaming music, on a network or on the device, is that you should only need to load a very small part of that song at a time. Typically only the very small amount of the audio data that the app needs is loaded into a ring buffer and then that song is being played on a very high priority process. The whole point being, not to load the entire song in RAM. Just enough to avoid audible skipping when playing back that music. And that's around the range of, a few seconds, maybe more to avoid playback problems.
If they weren't doing that, old iPhones would die the instant you tried to load up an hour thirty podcast.
Now, Spotify in particular reportedly caches TONS of audio ahead of time, but that's only being pulled from your network and saved to your SSD or hard drive. Even there, only the small bit of data you need for the song that you're listening to gets thrown into RAM.
Just going to walk away from the discussion at this point, I have no idea about technical limitations or tradeoffs or what have you with the OS. But this is a problem that can definitely be solved in software.