I am experiencing the same issue. Bought my iPhone XS Max 256GB Gold on the Sunday after the launch day (Friday). I am running public beta iOS 12.1 so am not sure if it is related to that. The top (earpiece) speaker stops functioning during music or video playback during random situations. I have been unable to duplicate it manually. You are right that a reboot solves it or even a simple shut down and restart solves the issue but only temporarily.
I use the following regularly-
iOS 12.1 Public Beta
CarPlay
Facetime
Bluetooth devices
Skype for business
and various other apps
It's difficult trying to narrow things down what is ultimately causing this or is it that the speaker is defective. Not sure. The last occurrence was right after I disconnected from CarPlay. Shut the car off and disconnected my phone and the speaker was out.
Is it limited to 256GB Xs MAX? Is it the Beta 12.1? Is there an app that causes this?
I have reported the issue.