HOUSTON –- Apparently, 49ers coach Jim Harbaugh figured the risk of injury far outweighed the possible benefit of the starters getting another chance to work together before the start of the regular season.

Quarterback Colin Kaepenerick and all but three of the 49ers’ expected opening-day starters were held out of action in the exhibition finale against the Houston Texans.

Texans first-year coach Bill O’Brien played it the same way, as the Texans sat 18 of their 22 starters.

With the NFL deadline looming to trim rosters from 75 players to the regular-season limit of 53, soon-to-be-former 49ers and soon-to-be-former Texans saw most of the action. And the 49ers’ reserves came through with the 40-13 victory in the final tuneup game for both teams.

Blaine Gabbert started for the 49ers and got off to a rocky start before finishing strong.

He threw incompletions on five of his first six attempts before hooking up with tight end Derek Carrier on a 32-yard pass that he precariously placed between two defenders along the sideline while rolling to his left.

He ended up capping a 12-play, 84-yard drive with a 14-yard touchdown pass to undrafted rookie tight end Asante Cleveland. Gabbert finished the night 4 of 11 for 60 yards and a touchdown.

Johnson makes case: Six-year veteran Josh Johnson certainly made a strong case for a roster spot. He completed 14-of-17 passes for 135 yards with three touchdowns and one interception.

He did not wait long to lead the 49ers into the end zone. On his first snap of the game, Johnson found rookie Bruce Ellington for a 13-yard touchdown pass. The 49ers have three quarterbacks on their roster, but the team could opt to keep only two on the 53-man roster.

Johnson’s touchdown was set up by cornerback Chris Cook’s interception and 33-yard return. Cook, who does not have an interception in four NFL regular seasons, recorded his second pick this preseason with the 49ers.

Johnson also hooked up with reserve tight end Kyle Nelson four touchdown passes of 5 and 2 yards. Johnson’s last touchdown was set up by a beautifully thrown 49-yard pass to Lance Lewis.

Good sign for Wilhoite: Linebacker Michael Wilhoite did not play in Thrusday’s game. And that can definitely be interpreted as a good sign in his bid to replace NaVorro Bowman.

Nose tackle Ian Williams was the only projected starter who was in the starting lineup. Williams is returning from a season-ending broken lower leg he sustained in Week 2 of the regular season against the Seattle Seahawks.

The 49ers have held off on announcing who will start alongside Willis with Bowman out for at least the first six games of the regular season. Wilhoite appears to have won that job. Bowman will open the regular season on the reserve/physically-unable-to-perform list.

Harbaugh in midseason form: Gabbert broke away from the pass rush to scramble for a first down early in the second quarter. But referee Walt Anderson blew the play dead, explaining that Gabbert was in the grasp.

Harbaugh objected strongly to the call, prompting Anderson to throw a penalty for unsportsmanlike conduct on the 49ers bench.

This ‘n’ that --Rookie Chris Borland into the end zone in the third quarter when he jumped a route early in the third quarter to intercept rookie quarterback Tom Savage. Borland returned it 34 yards for a touchdown that gave the 49ers a 24-6 lead.

--The Texans came back with an interception return for a touchdown of their own. Johnson threw behind 49ers wide receiver L’Damian Washington, who reached back but could not haul it in. Cornerback Andre Hal picked off the pass and raced 77 yards for a touchdown to make the score 24-13 with 2:19 remaining in the third quarter.

--Running back LaMichael James had a busy first half. He handled all of the 49ers’ return chores while also carrying six times for 39 yards. James averaged 21 yards on three kickoff returns, and he handled two punts with no return yardage.

--Tight end Derek Carrier was ruled out for the game with a hamstring injury he sustained in the first half.

--Wide receiver Kassim Osgood certainly did nothing to hurt his case for a roster spot when he broke free up the middle to block a punt out the back of the end zone for a safety in the fourth quarter.