I have 2 gmail accounts, and this worked for both of them. I deleted all keychain items for "smtp.gmail.com", then created 2 new ones from scratch directly in Keychain Access. You can call them whatever you want to differentiate them, but make sure you edit the "Where" attribute of each keychain item so that it correctly shows "smtp.gmail.com". Specify the account each keychain item will represent and add the password.
Then, I went back to Mail, deleted all gmail smtp servers from my list, and manually added them back in, one for each account. It doesn't matter that Mail doesn't save your smtp password (and it doesn't--you can immediately go back after creating the smtp server and see that it's gone) because you've already manually created a keychain item for it, so you know it's there.
One of mine initially didn't work using this method because I had created the keychain item for myname@gmail.com, but Mail truncates it to just "myname". I corrected the account name to match what was in Mail, and it worked after that. I hope this helps.