Autotrophic and heterotrophic organisms in anaerobic condition
It is not necessary that all heterotrophs are aerobic. Many are anaerobes (yeast etc.)
Anaerobic Heterotrophs

These anaerobes live on glycolysis and fermentation (as far as I know). These two processes don't require Oxygen for release of energy.

Glycolysis

Alcohol Fermentation

Lactic Acid Fermentation

Alcohol Fermentation takes place in yeast (just an example) and Lactic Acid Fermentation in Muscle Cells.

The autotrophs will take care of themselves as photosynthesis require no Oxygen. If place in correct conditions (light and water are available), then they will thrive.

So, the answer to your question would be that both can survive. It varies from species to species. If you select the correct one then, both would survive or only one of them.