My understanding --admittedly limited-- is that in Japanese, people say as much as they can with as little words as possible. So I wondered why ないだろう would be used in everyday speaking instead of まい? The latter seems shorter and easier to use than the former.
To answer the question in the title, yes, it is generally only used in literary text and, I would say less often, on TV. It could also potentially be used in a really formal speech or something like that.
I remember in my 9th or 10th month of studying the language I tried this out on a Japanese friend, saying something like
Sure, it's fair to say that users of the Japanese language tend to shorten things a lot, but that's not to say that the shortest way is always the normal or "modern" way. For example, the archaic form