The 18-year-old claimed all the four Railway batsmen to fall to peg back the hosts after they bundled out Hyderabad for a paltry 166.
Apart from Anirudh Singh (92), none of the Hyderabad batmen showed any application on the placid Karnail Singh stadium track as the visitors were bowled out 25 minutes before tea.
The hosts looked like running away with the tie when their openers Amit Pagnis (42) and Sanjay Bangar (24) gave them a solid start.
But Ojha, introduced as a second change bowler, claimed the wickets of Bangar and Tejinder Pal Singh in the same over and then scalped another two to restrict Railways at 103 for four at stumps, after they were cruising at 69 for no loss at one stage. All-rounder J P Yadav (23) and Yere Gaud (0) were at the crease at close.
Ojha, who took 53 wickets in the nine matches in the Under-22 C K Nayudu trophy this season, was a bit unlucky as Raja Ali (10) was dropped twice in one over but the youngster had the last laugh when he had the batsman leg before wicket while not offering a shot.
Earlier, Hyderabad batsman failed to justify their captain's decision to bat first as they lost two wickets in the very first over without any run on the board.
Harvinder Singh was the chief tormentor as he claimed four wickets for 28 runs and was well supported by J P Yadav (3/55) and Murali Kartik (2/41).
Hyderabad coach Rajiv Yadav was very disappointed with his team's batting performance but said Ojha had brought them back into the game and they would not try to put more pressure on the host on Saturday.
Railways coach Vinod Sharma said the team would be looking for a lead of at least 150 to 200 runs and the opening first hour on Saturday would be very important.
"We will be looking at a lead of about 150-200 runs. Otherwise the match will be wide open and considering that we have to bat last taking the lead is very important," he added.