Cavity-assisted mesoscopic transport of fermions: Coherent and dissipative dynamics