Mass General Brigham said Tuesday it will invest $400 million on cancer care, not long after announcing layoffs that impacted hundreds of workers in Massachusetts.