An M-theoretic derivation of a 5d and 6d AGT correspondence, and relativistic and elliptized integrable systems