He had the upper hand on Terol pace wise after the half way mark. I think he wanted to play with Terol to show his dominance. Hence the first weird moment, I think it was with about 9 laps to go, when he overtook Terol, but that than looked back at him at the start finish straight. Looked to me like he was taunting him. At that point he should've just taken off and everything would've been fine. But he purposely let Terol reovertake him, I think. Then, with 2 laps to go, he did overtake Terol and I think at that point was all set to take off, but made a mistake and ran wide somewhere. Perhaps that's when it hit that him that his own cockiness earlier may just have cost him the race and possibly the championship. And I think that's when he went into full on crazy mode. Coming out of the last corner, I imagine he was already convinced Terol would come out of his slipstream and beat him to the line. So he went crazy and did his stupid move. The irony of course being that, had he simply kept his head down and the gas open, he'd probably won.
Lot's of if's and but's, but that's how interpreted it.