A good riddle should have one answer. Once you find the answer it should be fairly obviously correct. It should not be obvious what the answer is before you find the "trick" of the riddle. And it should not be impossible to solve without being a mind-reader.
For example, we can take the classic riddle of the sphinx as example:
Which is the creature that has one voice, but has four feet in the morning, two feet in the afternoon, and three feet at night?
The main "trick" here is that the morning, afternoon and night are a metaphor for childhood, adulthood and old age. Once you understand that, it becomes fairly easy to find that the answer is a human (crawling on all fours as a baby, walking on two legs as adult, and using a walking stick in old age).
There are two problems I've often come across that make some riddles effectively impossible to solve. The first is when there are dozens of possible answers that fit the clues of the riddle. When that happens, it just turns into a guessing game, hoping to hit on the particular answer the riddle-maker had in mind.
There is also the opposite problem, when the riddle just doesn't contain enough clues to let people make the leaps of thought necessary to get to the answer. It's easy to get in this situation, because often you create a riddle starting from the answer, and going from answer to clues may be more obvious than the other way around. And because as creator you know how to solve the riddle, it can be hard to put yourself in the shoes of someone that doesn't know. (The solution is to test it on unsuspecting friends. Or maybe puzzling SE)
To create a riddle, it's often a good idea to start with the answer and work backwards. Since it has to be part of a story, it would be nice if the answer (and riddle) is in some way meaningful. For example, it could have something to do with the hero's struggles in the story, or the story's moral.
Once you have an answer in mind, think of ways to describe it, what properties does it have, what things are associated with it, are the proverbs and idioms that involve it, etc. And finally choose some of these clues and assemble them into a riddle.
Why does there have to be a riddle at the end of the dungeon, though? What does it add to the story? Could it just be a knowledge question, instead of a riddle? Or could it be a logic puzzle? What's the in-story reason for this event?
If the statue is guarding some ancient power that let's one rule the world, I should hope the test of worthiness would be a bit more extensive than just guessing the answer to a simple riddle. That statue should be holding an in-depth job interview to assess the hero's overall competence for being supreme ruler, including intelligence tests, psychological tests, tests for management skills etc. ;)