Hydrocarbons are made of carbon, hydrogen and oxygen. The idea would be that the bacterium would "eat" the CARBON diOXIDE and somehow combine that with the diHYDROGEN monOXIDE around it to form hydrocarbons. However, to create hydrocarbons it would have to be imparting energy to the molecules in order to form them, and where is it going to get that energy from? And if it has to take in energy from somewhere in order to impart that into the hydrocarbons, then unless we are hooked on forming hydrocarbons, then there would be more efficient ways using the bacterium's energy source.
It isn't even a matter of chemistry - physics can tell you that this isn't likely to be viable.
it sunlight.
Photosynthesis normally turns carbon dioxide into sugar and all the carbohydrates the plant needs to build and feed it's self, now though these bacteria also produce a extra hydrocarbon and excrete it.
it's like modified photosynthesis.
And all the mas of the plant life around you shows you how capable that is of turning the co2 in the atmosphere into a solid (or liquid) product.