I have several Google accounts set up in System Preferences > Internet Accounts on macOS 10.14.5. The Google accounts have two-factor authentication. I'm able to log in the accounts via a Safari window, and then use them with Mail and Calendar without problems.
Until my Mac sleeps. On wake, it demands that I log the accounts in again, requiring several rounds of password and two-factor authentication.
I have tried using Google's app-specific passwords, but they aren't accepted at the login prompt that pops up from System Preferences > Internet Accounts.
Is there a method to keep macOS logged in indefinitely?
Note: This does not appear to have the same cause as Can't login with Google using Internet Accounts — the answers there did not solve the problem for me.