Maximum principles on Riemannian manifolds and applications