Frodo was NOT demoralized. He had grown great in wisdom and bravery. He was also functional and loving, and finished Bilbo and Frodo's book. But he had seen enough evil, and seen what the world had to offer -- and literally chose God and God's presence over staying in Middle-earth. His ending is sad for Middle-earth but NOT for Frodo :-)
It's been a few years since I've read the books, so I can't quite recall if Frodo was "demoralized," but I do remember he was somberly affected by his experience.