And Putin expected Ukraine to buckle in 3 days. 
As for Afghanistan, we left them with a well equipped army, they just didn't have the will to fight. In hindsight we should have either stayed longer or left once OBL was killed.
Ukraine was never going to buckle in three days. It has had weaponry provided to it by NATO countries, and will have had training provided also. It's also a huge country. Russia also went in without maximum force for the first few days or more.
As for Afghanistan, the Saigon/Kabul imagery takes some beating.