ALLENTOWN — Given the season he’s had, you got the feeling that Mason Williams was due for a night like Wednesday.

Let’s face it, the 25-year-old hasn’t had much of a season, playing in just 43 regular-season games. Williams missed nearly half the year recovering from right shoulder surgery last June and didn’t return to the field until July 2 when he began a rehab assignment with the GCL Yankees.

If that shoulder injury wasn’t enough, Williams suffered a quad injury July 30 that landed him back on the DL after just 12 games with the RailRiders, costing him two more weeks of games and possibly a promotion once the major league rosters expanded last week.

But Williams has proven to be a valuable piece down the stretch for the RailRiders. After he was activated Aug. 14, he hit .312 with 14 RBIs over the final 19 regular-season games.

When the RailRiders took the field at Coca-Cola Park for Game 1 of their Governors’ Cup semifinal against Lehigh Valley, it was evident early that Williams was going to be a key factor. He led off the game with an infield single and recorded five of the first seven outs defensively.

But Williams’ biggest contribution came in his final at-bat in the eighth inning with the game still scoreless. He came to the plate already 2 for 3 on the night and two pitches later, Williams finally got his moment, blasting Ben Lively’s hanging breaking ball for a two-run homer that proved to be the difference in the RailRiders’ 2-0 victory over the IronPigs.

“I’m just trying to get the team going, really,” Williams said. “I just want to get the team going and start playing our ball and get the momentum on our side.”

Williams legged out an infield single on Lively’s second pitch of the game and hit a one-out single up the middle in the sixth. He came to the plate again in the eighth after Jonathan Diaz drew a two-out walk. Given the previous three at-bats, manager Al Pedrique knew Williams was the guy he wanted up in that situation.

“Mason showed early that he had good at-bats against Lively so we were hoping that he would get a good pitch to hit and hit a ball in the gap and give Diaz, who runs well, a chance to score from first base,” Pedrique said. “He got a good pitch to hit and he took advantage and right field is a short porch and we were lucky on that part.”

Williams entered Wednesday having not homered in 51 career Triple-A games. In fact, his last homer came in his major league debut June 12, 2015 at Baltimore. The last one before that was Aug. 25, 2014 when he was at Double-A Trenton.

On paper, that two-run home run was the difference in the game but make no mistake about it, Williams’ glove was just as important. He tracked down a deep fly by Nick Williams before tumbling to the ground to end the first inning.

He did the same in the seventh, getting a jump on Cody Asche’s liner and made an over-the-shoulder grab on the run to take away extra bases for the second out. What made that catch even more spectacular was that Brock Stassi singled on the next pitch and Cedric Hunter followed by flying out to the right-center field warning track to end the innning.

So if Mason Williams doesn’t make the grab, the IronPigs very well could have taken the lead in that seventh inning. Instead, his fantastic defense kept the shutout alive, put Jordan Montgomery in line for a much-deserved victory and set up his eighth-inning theatrics.

It’s been a long road back for the speedy outfielder, which makes games like Wednesday — with that kind of magnitude — that much more special.

“Any time anybody needs to work real hard to get back on the field and be able to come through and help the team to win and play the way he did tonight is well-deserved,” Pedrique said. “He’s been nothing but a great kid to have in the clubhouse. I had him last year in Trenton and he was fun to watch on a daily basis playing center field. For somebody to get rewarded like that, I’m sure it’s very special for him.”