Your argument is based on an opinion - "praying is irrational (because it clearly cannot work)" - that religious people do not hold! If they were to share your opinion I guess most would abandon the practice.
In this context one can see why they choose to raise their children in such a way. It would be irrational not to teach them how to pray if this is such an important part of their lives. Would you wait for your kids to grow up before teaching them personal hygiene because it is ultimately their choice?