The Terriers were 1-0 down to the Conference side in the first minute of stoppage time when Roberts, just back from a broken arm, swung over a corner from the right.
It was only half-cleared and it fell to Lee Peltier on the edge of the box, with the full-back smashing in the equaliser through a crowded penalty area.
Roberts then snatched victory with just seconds to go by blasting into the roof of the net from close range after Benik Afobe laid off a cross from Jordan Rhodes into his path.
It completed a stunning resurrection for Huddersfield, who seemed down and out in this first-round replay after Cambridge midfielder Rory McAuley headed the visitors into the lead from a James Jennings corner.
Huddersfield were lethargic throughout and only came to life in the last 10 minutes. Up to then Cambridge dominated, with Wayne Gray, David Partridge and Paul Carden going close.