Jesus commands the people to pray, and they do. They “did pray unto Jesus, calling him their Lord and their God.” Why did they pray to Jesus?
The Nephite doctrine of the Messiah was that it would be their God come to earth. Thus, they believed it was Jehovah who stood before them. In the modern Church, we also understand that Jesus is the mortal aspect of Jehovah, so they prayed to their God as they had always done.
The idea that there would be a Father that is different from Jehovah, was a new teaching for the people. Even though it had been emphasized multiple times, including that morning, that they were to pray to the Father in Jesus’s name, they had not yet fully understood and internalized that teaching. The glorified being standing before them was rather obviously more than human, and all of their previous teaching said that it was their God who would visit them. He was there. It is hardly surprising that they would pray to him directly.