There is nothing inherently preventing these things to be done with electricity from renewable sources (and the carbon for the chemical processes only acts as a cheap oxygen acceptor). It is just that burning coal is still cheaper and has existing infrastructure.
There are many economic areas where replacing fossile fuels is indeed very difficult, and only mining somewhat falls into those. The material processing necessary for solar panel production would be actually more simple and energy efficient with electricity. For example a lot of aluminium ore is already processed with electricity produced from geothermal sources in Europe.