This prayer is a positively asking prayer:
"May He...comfort your hearts," Paul is asking the Lord to encourage their hearts in light of him being the everlasting comforter. Paul knows that Christ is more than able to provide comfort in every circumstance and doesn't pray against the circumstance but for encouragement for the believers to be able to persevere through the circumstances.
"May he...establish your hearts in every good work and word." Not that God would just establish them in some good works but in every good work. That He would root them down in righteous deeds and words. That they wouldn't be pulled up from righteous living just because times get rough. Paul is mindful that circumstances are for a time and those who are rooted in Christ and who follow Him are the ones who get the reward eternally. We remain faithful to God through God's own strength and comfort. He establishes us in every good work and word. He is able.
Establish is something that isn't easily torn up. It's permanent actually. When God establishes us, He does it with everlasting power. We may grow tired but we must then wait on the Lord to renew our strength to continue in these words and deeds.