You're reading the chart wrong. The chart states that the iPhone 3G, released in June 2008, ran the current OS for three years after release, which is correct: the iPhone 3G was updated to iOS 4.2.1, which was released on November 22, 2010, and it continued to run the current major iOS 4.x series until iOS 5 was released in October 2011. (Granted, it stopped receiving updates in March 2011 with iOS 4.3, but that was still the same major version series.)
The iPhone 3GS, meanwhile, will likely get support for at least 4 years, given that Apple is still selling the iPhone 3GS and, historically, provides at least 2 years of support.
As for the Samsung Galaxy, which Galaxy? The Samsung i5500 is pre-loaded with Android v2.1, in the summer of 2011. That's 2 major releases behind!
The Samsung Galaxy S II, meanwhile, was shipped with Android v2.3, which is still the current version (4.0 hasn't shipped yet). It's rumored to be getting ICS, which is good, but previous Samsung phones were also promised to get updates...which never happened. So we'll need to wait-and-see.