Shogun clearly, tho some people will claim he's tarnishing his legacy by sticking around so long. I don't believe you should be based on what happens at the end of your career but a lot of dumbasses wanna discredit fighters who do stick around too long. IMO, losing at the end does not erase what you did at your prime. Hell, to me it doesn't matter at all.
They both held the belt for the same amount of time and Shogun beat him 2x. Now if Machida can get the MW belt that'll be something. Also, Shogun was ranked #1 for a long time without the belts while Machida's time @ the top was short lived.
Like I said, losing at the end does not erase what you did in your prime.
It's not like with Chuck or any or the pre-Pride buyout UFC champions who were big fish in small ponds. When Shogun was UFC champ, he was the top fighter in the world. When Chuck was, he wasn't the best and lost as soon as real competition came to the UFC so yeah...