Manchester City were beaten 2-1 by Bayern Munich at the Allianz Arena as the European champions claimed the Audi Cup in front of a home crowd.