Despite an encouraging start from Derby, former Plymouth Argyle striker Mason gave the Bluebirds a half-time lead with his 11th goal of the season on Tuesday night.
And on the hour, defender Hudson sealed the win with a wonder goal, firing past Frank Fielding from inside his own half to extend Cardiff’s unbeaten run to eight league matches.
Malky Mackay’s side now sit four points clear of seventh-placed Middlesbrough, who were held to a goalless draw by relegated Doncaster tonight, with two games remaining.
Nathan Tyson had a goal disallowed for the Rams with the score at 0-0 and, despite an encouraging performance, Nigel Clough’s side slipped to their second successive league defeat.
After firing wide from 20 yards, Kenny Miller finally tested Fielding, who tipped the former Derby striker’s 18-yard shot round the post.
Derby thought they had opened the scoring after 14 minutes when the recalled Tyson converted a flick-on from Theo Robinson, but the former Nottingham Forest forward was deemed to be in an offside position.
The game started to open up, with Fielding having to turn away an Aron Gunnarsson strike from distance while Paul Green, earlier thwarted by a solid defensive block by Andrew Taylor, brought the best out of home number one David Marshall.
But it was Cardiff who broke the deadlock in the 24th minute through Mason, who converted after Miller’s strike cannoned back off the post.
The visitors refused to lie down and continued to show their attacking intent, but Jeff Hendrick and Tom Naylor failed to hit the target with long-range efforts.
Defender Jake Buxton called Marshall into action just before half-time with a header from Jamie Ward’s corner as Derby finished strongly.
Cardiff doubled their advantage in emphatic fashion after 63 minutes when Hudson collected a poor Fielding kick and, after trying his luck from inside his own half, saw his effort evade the backtracking Derby shot-stopper and nestle into the net.
Derby tried to get back in the match, only for Marshall to continue his fine performance in the sticks by tipping a Hendrick header round the post, while Craig Bryson fired wide from 25 yards.
The Rams’ wayward finishing proved to be their downfall as Robinson this time missed the target, shooting over from 18 yards.
In the final minute, Derby almost netted a late consolation but Marshall was equal to John Brayford’s shot, while substitute Robert Earnshaw saw a shot blocked at the other end as he sought a goal against his former team.