What I have found is that if I open Spotify then manually hit play/pause, the buds work. Spotify is the only app that seems to behave this way as Play Music works normally. I also occasionally get Spotify crashing when using them. Don't have this problem with my Jabra Elite Active 65t .
Samsung Galaxy S10+ (Android 9) with Galaxy Buds (SM-R170)
I have had the exact same problem. I found out it was because I had set my spotify app to go to sleep when "not in use". This is why it worked only for a few seconds after I manually pressed play/pause. Go into your phone's settings. Go to Device care and tap on the battery settings. From there find the Spotify app among all your other apps and once you tap on it you will get some information about battery usage. The very last item should say "Put app to sleep". You want to make sure this is off. Hope this helps, it worked for me.