A duality-based approach for distributed min-max optimization with application to demand side management