The Norwegian was concerned about a potential clutch problem at the end of the Ibarrilla stage.
He had still been second fastest, albeit eight seconds down on leader Sebastien Ogier, whose lead had stretched to nearly 40s.
When Ostberg investigated the issue on the subsequent road section, it became clear that his M-Sport Ford was suffering an alternator glitch and would not be able to continue.
His retirement elevates Mikko Hirvonen's Citroen to second, 53s behind Ogier.
M-Sport also still has a car on the provisional podium, as Thierry Neuville is now third following Ostberg's exit.
Ostberg says he has no doubt that he could have hung on for second place in Rally Mexico had his M-Sport Ford not succumbed to mechanical problems on Saturday morning.
"Off the start in the first stage, I felt the clutch was a bit strange," Ostberg said. "It didn't pull cleanly off the line.
"Then I drove for a while in the fast stuff where you don't use the clutch, but then I got into the technical sections where you need the clutch coming out of the hairpins and it went straight to the floor. I understood the clutch was gone about halfway into the stage.
"On the road section we stopped to see if there was anything we could do. We could see the problem, it was a broken fitting going onto the pipe.
"There was nothing we could do, but it was possible to drive because the clutch was on the plate.
"We were driving through town when I suddenly had an alternator warning on the dash saying the voltage was low, but this was a different problem. After five minutes it was dead.
"I am 99 per cent sure the alternator would have got us if the clutch didn't - they are two different sides of the car."
This is the second event in succession where Ostberg's challenge for the lead has been hampered by a mechanical issue.
"I was quite angry and very disappointed," said Ostberg. "We took time from Mikko, even with the problem and it could have been quite a comfortable situation and result."
- Sports & Recreation