I am not a battery
In the Matrix humans are used for the body heat they generate which is then converted into electricity, if you recall you will have heard Morpheus mention the power produced in BTUs which is of course British Thermal Units.
This bacteria option is far more direct and would enable the machines to dispense with humans altogether.