"As they were coming down the mountain, Jesus gave them orders not to tell anyone what they had seen until the Son of Man had risen from the dead. They kept the matter to themselves, discussing what 'rising from the dead' meant." NIV translation
Jesus told the men to keep what they had seen to themselves until His resurrection. Even though they had seen Moses and Elijah on the mountain, they still did not understand what Jesus meant about His resurrection. They were still thinking of the Messiah riding in and establishing His kingdom in Jerusalem.
"And they asked him, 'Why do the teachers of the law say that Elijah must come first?'" NIV translation
In trying to understand what was going on, the men went with what they had been taught. The teachers of the law taught that Elijah would come back before the Messiah based on the words from the prophet Malachi (see Malachi 4:5). Although they did not say so, they were probably wondering if what they had seen was a fulfillment of those words.
"Jesus replied, 'To be sure, Elijah does come first, and restores all things. Why then is it written that the Son of Man must suffer much and be rejected? But I tell you, Elijah has come, and they have done to him everything they wished, just as it is written about him.'" NIV translation
We learn much from Jesus' answer to their question. First, we see His patience with them as He answers their question. We also see that His answer does not contradict the word that was given to Malachi. He explains that it has happened but not in what they saw on the mountain. When He spoke of Elijah restoring things, Jesus was speaking of the fact that he had come in the form of John the Baptist calling Israel to repentance. This was a necessary first step for them to see that they needed a Savior. He also tells them of what lies ahead for Him in Jerusalem.
"When they came to the other disciples, they saw a large crowd around them and the teachers of the law arguing with them. As soon as all the people saw Jesus, they were overwhelmed with wonder and ran to greet him." NIV translation
The group from the mountain (Mount Hermon) joined the other disciples but there was an argument going on. The teachers of the law who should have been in Jerusalem were out keeping an eye on the disciples. The crowd of people ran to Jesus and that was why the teachers of the law were there. They were concerned about losing their power and position and were trying to find a charge against Him.