HI,
I had an issue tat seemed to arise in Sierra that was not there before about logging in to what was my Google Talk account in Messages.
Firstly I have set Less Secure apps at Google.
Logging in to Google Web Mail is my normal starting point.
Then use the pic you have top Right to access the panel and select My Account.
The page that appears looks like this:-
I chose the third option of App and Sites.
The whole Menu now appears on the left and you have to scroll down to Apps and Sites
As you can see I have Less Secure apps On.
This is because Messages uses SSL in most cases to sign in to servers including the Google one where as Google now have there own Oauth tokens and have deemed SSL "Less Secure".
I have never tried the 2 Step Verification from Google as suggested above.
That was my set up before I had the new issue and is still my set up now.
In System Preferences > Internet account I had Google set up for Mail and Messages and until Sierra this worked.
Messages and the Google account then refused to Login and changing the Server Settings for the account in Messages did not work (it is over ridden by Internet Accounts).
What I did was remove the Google Account from Mail, Internet Accounts and Messages.
I then deleted the com.apple.iChat.Jabber.plist from ~/Library/Preferences
Open a Finder window. Use the Go Menu whilst holding down the ALT Key.
Select the Library that appears.
Navigate to Preferences (Drag the item to the Trash)
Then I restarted Messages and Added the Google account.
I checked the Server setting tab:-
SSL, port 5223 and the server name of talk.google.com
I then went to System Preferences > Internet Account and the new Google Account and enabled Mail.
It now logs in to Google's Talk server and to it's Mail Server without issue.
What I did find in El Capitan is that Yahoo, Google, Linkedin, some AIM Accounts (I have more than one) became active for Contacts in System Preferences > Internet Accounts which causes issues for Messages - Messages has to wait until they are all checked but Contacts gets stuck in an endless loop of checking all the servers again and again even when there are not changes effectively blocking the use of Messages.
I hope this helps.
7:53 pm Friday; February 17, 2017
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
iPhone 6 iOS 10.x and an iPad (2)