The former officials, who served under both Republican and Democratic administrations, criticized William Barr, the country’s top law enforcement officer, for overruling his own prosecutors in a case that has prompted accusations that the Trump administration is weakening the rule of law.