Coal has plenty of uses. It can be used to make precursors for everything from plastics to carbon fiber. In fact in the 19th century it was the original source of chemicals and materials from dyes to aspirin to tarmac.
In the beginning of 20th century it started to be displaced by the cheap and abundant oil.
Coal's major role in electric power generation is relatively recent. Although coal continued to be a major source of important petrochemicals such as benzene into the 60s, the coal industry underwent a major crisis in the beginning of the 20th century and in the US in particular was saved by the country's electrification.
I expect that this pendulum will swing the other way. Coal is posed to become a major source of materials and chemicals once again.
Some helpful links:
https://web.anl.gov/PCS/acsfuel/preprint%20archive/Files/37_...
https://web.anl.gov/PCS/acsfuel/preprint%20archive/Files/39_...
http://www.ogc.co.jp/e/products/carbon-f/
https://eic.rsc.org/section/feature/feture-pain-relief-from-...