Billy Sharp's neat finish had earlier cancelled out Richards' 20th-minute opener and despite dominating large swathes of the match, Sharp's effort was the only time the hosts could beat an inspired Chris Martin in the Vale goal.
A much-changed United went close twice in the opening 10 minutes, with Sharp's rasping shot well turned around the post by Martin and then moments later home debutant Glen Little fired wide from eight yards with the goal gaping.
Vale slowly began to assert themselves in the game and took a surprise lead with their first attack in the 20th minute.
Sam Stockley did well to head Robert Taylor's deep cross back across goal and after the ball eluded Ian Bennett's despairing dive, Richards was left with the simplest of tasks to tap home from two yards.
Despite surviving another scare when Taylor flashed a shot just over, the hosts soon hit back and levelled in the 33rd minute with a fine goal. After some incisive play down the left, Little fed Sharp and with his back to goal, he produced a neat turn and curling shot which left Martin helpless.
Early in the second half, United saw Little's effort cleared off the line by Gareth Owen.
Then the decisive moment of game came on the hour mark when Richards curled a tame 20-yard free-kick straight down the throat of Bennett, but the former Birmingham man spilled the ball over the line in front of a rapturous Vale following.
United rallied, forcing a fine double save from Martin who kept out close-range efforts from Jordan Robertson.
United eventually ran out of ideas to give Vale their victory.