M-theoretic derivations of 4d-2d dualities: from a geometric Langlands duality for surfaces, to the AGT correspondence, to integrable systems