Photo: D. Ross Cameron / Associated Press

Matt Breida ranks fourth in the NFL in yards per rushing attempt and is fifth in runs of 20-plus yards.

This leads to the logical question: What could he do on two good ankles?

The 49ers hope to discover the answer in 2019 after Breida’s season ended Sunday when he exited with an ankle injury in the second quarter of a 14-9 loss to the Bears.

That should sound familiar. Breida sprained his ankle in a Week 5 loss to the Cardinals and it never fully healed. He’s only missed one game because of the ailment, but he won’t play in Sunday’s season finale against the Rams after he aggravated it for a final time against Chicago.

“He’s battled every week to get in there and play for us,” head coach Kyle Shanahan said. “He’s ended up hurting it every week. So it’s lingered all year. Just a credit to him to still be effective when he’s been out there. (The way) he’s been able to help us throughout this year has been unbelievable. He has not been 100 percent for a while.”

Still, Breida often looked fully capable at less than full strength. He had 814 rushing yards and averaged 5.3 yards per carry, which is the third-highest average in franchise history for a running back with at least 150 attempts.

Breida is in select company. He ranks behind Hall of Famer Joe Perry (6.1 yards per carry, 1954) and Frank Gore (5.4, 2006), who is fourth in NFL history in rushing yards.

It’s fair to say Breida has beaten some odds: He averaged 3.8 yards a carry in his final season at Georgia Southern and went undrafted last year. It wasn’t just the unimpressive end to an otherwise stellar college career that scared off NFL evaluators. There were also concerns about Breida’s ability to withstand punishment at 5-foot-11 and 190 pounds: After all, he would no longer be facing Arkansas State.

However, Shanahan was largely pleased with Breida’s durability this season.

“Besides the ankle,” Shanahan said, “he was able to handle the wear and tear with the rest of his body.”

It wasn’t just his ankle, however. Breida left a Week 3 loss to the Chiefs because of a knee injury, which made him questionable for the next week. He was then listed as questionable for the next two games because of a shoulder injury. Breida has been on the injury report before 10 of the 49ers’ past 12 games.

But the 49ers likely won’t ask him to carry such a large load in 2019. Breida will share the backfield duties with a group that should include Jerick McKinnon, who tore his ACL before the season opener after signing a four-year, $30 million contract.

Shanahan has said McKinnon’s injury was significant because much of the offense was tailored to his dual-threat ability as a runner and pass-catcher. There were also plans for McKinnon and Breida to be on the field together.

“I envisioned it this year,” Shanahan said last month. “So that won’t change next year.”

Breida’s performance in McKinnon’s absence means the 49ers don’t have to envision how he’d fare in a lead-back role. He’s more than a stopgap measure primarily because of his elite speed: He hit a top speed of 22.09 mph last month on a 33-yard run against the Buccaneers, which was the fastest of any ballcarrier over the past two seasons, according to Next Gen Stats.

His wheels were also on display in a Week 2 win over the Lions when he had a 66-yard touchdown sprint that was the 49ers’ longest of the season.

As it turned out, it was the last game in which Breida was fully healthy.

But the way he performed through pain gives the 49ers’ backfield a healthy outlook for 2019.

“Matt stepped in right away,” Shanahan said, “and played like a No. 1 back.”

Eric Branch is a San Francisco Chronicle staff writer. Email: ebranch@sfchronicle.com Twitter: @Eric_Branch