This problem still exists on macOS Big Sur 11.3.1 with Apple Music 1.1.4.110. The keys for play/pause, next and previous track work fine in Spotify and Pocket Casts for example, but don't work in Apple Music. Does anyone know what can cause this problem with media keys?
UPD. I've tried MacMediaKeyForwarder - https://github.com/milgra/macmediakeyforwarder/releases but it wasn't working for the first try for some reason (was “not responding” in Activity Monitor). I deleted it and then installed again, and it started working. So, it actually helps solving the problem with media keys.