Thats what praying is. Its old english for talking. You can talk to God or you can talk to me. Moses was dead or was he? Either way Jesus was preping for his suffering and crucifixion. Its likely they were discussing this. Thought he scriptures haven't told us exactly what they said to each other however it is conspicuous that its just prior to his last visit to jerusalem and He had just told his disciples that he must suffer. Yet Jesus was communion with both these men who've passed on to the next life.
Now the Catholic argument would say that a believer is not truely dead but alive in Christ as Moses and Elijah were on the Mount of Transfiguration. We see in revelation that the martyrs know whats happening on earth and speak to God about it. And complain that justice has not yet been carried out. In any way you look at it Jesus was speaking with a person who had died on that mountain.
Elijah and Moses were not attempting to intercede in behalf of Jesus to the Father. Neither was Jesus attempting to go through Elijah or Moses to reach the Father.
Jesus is our example and we find nowhere he either teaches by precept or example to pray to the departed as a means (thus a mediator) between himself and the Father or between living saints and Himself or the Father.
In regard to prayer, the bible says we have direct access to God (Heb. 10:19-20) and because of the shed blood of Christ we can come "boldly" or freely to God. The Bible explicitly says there is but ONE MEDIATOR between God and man and that is Jesus Christ, not Mary, not the Church, not the preists, not departed saints, not statues, pictures, or candles. These are all of pagan origin that have no place in the life of true Christians.
We do not find Matthew, Mark, Luke, John, Stephen, Paul, Peter, Jude, or any other New Testament writer or saint praying to such, or through such nor do we find any precepts to do so.
"To the law and to the testimony if they speak not according to this word it is because there is no light in them."