Prevent Android from closing a Progressive Web App playing audio in the background

You can't, today. This is somewhat related to MediaSessions (https://wicg.github.io/mediasession/), but you really need a background app, which is not a concept that's yet supported by the web. (It's related, also, to ServiceWorkers and Web Workers, but again, not precisely. It's really a difficult scenario, as such an app has a definite ability to drain batteries.)