Coal and oil contain carbon in a reduced form, where it has not given up all its valence electrons to another element.
Our atmosphere is about 20% O2, a reactive gas.
You are likely familiar with the rusting of metallic iron to a red iron oxide, a reaction that is quick enough for you to see it happen in a matter of months. This is an example of reaction between an element (iron) that gives up electrons easily to another element (oxygen) that would rather gain a couple of electrons per atom, to achieve greater stability.
Although it exists as the O2 we breathe without harmful effects, oxygen is actually ready to pounce on reactive elements for their coveted valence electrons. Your body (and all living matter) is largely made of carbon compounds that are kept relatively intact by all kinds of metabolic processes that constantly grow or repair our body parts against reactions with O2 molecules hungry for elements that could bond it into more stable compounds.
Once we die, bacteria start working on all those carbon compounds (actually a complex mix of C-H-N-O-P-S compounds). If the decay of organic matter happens in the presence of breathable O2, the bacteria take the nutrients they want, and also consume carbohydrates (C-H-O compounds) with the O2 they respire, getting energy and releasing water, CO2 and various simpler compounds as waste. There is no chance that any carbon will remain behind as coal or somehow turn to oil. In fact, oil spills that reach the Earth’s surface are picnics for bacteria, as scientists observe after some disasters (How Microbes Helped Clean BP's Oil Spill) and in natural oil seeps (Who Thinks Crude Oil Is Delicious? These Ocean Microbes Do). Fungi do their share to break down the tougher carbon compounds of plants (White Rot Fungi Slowed Coal Formation).
Ancient coal layers, when exposed to today’s oxygenated atmosphere, also degrade, more slowly and can even ignite on their own because of reactions between oxygen and reactive mineral impurities (Coal's Spontaneous Combustion Problem). Our burning of coal is simply speeding up the process, we provide energy to start a reaction between its carbon and atmospheric oxygen in order to releases heat and (an unfortunate by-product) CO2.
If the organic matter (of dead remains) is buried (and naturally sealed from bacterial decay in the presence of breathable oxygen), other kinds of bacteria take over and use other types of chemical reactions to draw energy from that food. They are far less efficient, however. Whatever they leave behind, under the mild heating and gradual increase in pressure during progressively deeper burial, slowly turns the carbon compounds to either coal (if the starting material was terrestrial plant matter) or a complex mix of hydrocarbon molecules of petroleum (if you start with mostly animal or marine organic matter, richer in lipids than terrestrial plants). If heated far enough, methane is the main product (CH4).
In landfills, organic matter can decay to methane, but this is done by specific types of bacteria. Bacteria do not convert organic matter to oil: they would have to spend energy to do so, and would derive no benefit from it.
It is possible to replicate these processes at Earth’s surface, in laboratory, but only by using equipment that keeps the biomass from reacting with atmospheric oxygen.