When a creature successfully saves against guardian of faith and takes 10 radiant damage, how much damage does that count against the total amount of damage the spell can deal? Is it 20 because that’s how much it dealt or 10 because that’s how much the target took?

It dealt 10 damage to the creature, so 10 is subtracted from the total.