In Animal Crossing: New Leaf, I have perfect peaches scattered around my entire town. On different occasions, I spot an army of ants swarming around a perfect peach. Will they eventually eat the peach or make it disappear?
I left a turnip out for a few weeks, it rotted (as turnips do) and attracted ants & flies. In short, they did not consume it.
So no, ants & flies won't eat food you leave behind.