There are theories, of course, one of which you mentioned: that for some reason a tragic death has prevented the person's spirit from moving on. (We are talking here of "intelligent hauntings," in which a person's spirit energy remains, as opposed to a "residual haunting" which appears to be merely a kind of recording on the environment.) Another is that, for whatever reason, the person does not know that they are dead and so do not know how to move on. A third theory is that the person has some unfinished business, and they need to relay a message or help solve a problem or issue before they can pass to the next level of existence.
Again, I must stress that this is all theoretical, based on the research of paranormal investigators and the experiences the living have had with spirits over the centuries. But the true nature of the spirit world -- if in fact that's even what it is -- remains a mystery that we may never fully understand.
Yes, it is especially tragic to think that children's spirits might be trapped like this, which is why EVP of children's voices are particularly disturbing. We hate the idea that an innocent child could be trapped and prevented from moving on for years or even decades. Some comfort might be gained, however, from the possibility that wherever these spirits are trapped might be devoid of time and space as we know it. In other words, although to us it seems that the little girl's ghost has been wandering the Queen Mary for decades, she might not be experiencing time in the same way at all. To her it could all be one brief moment.