Garrity’s total exceeded the previous record for state office held by Gov. Josh Shapiro in his 2000 race for attorney general.