Hydrodynamics of higher-rank gauge theories