Well-posedness of Lagrangian flows and continuity equations in metric measure spaces