Elephants are a special case. They have in past been shown to master elaborate IQ tests individually, and even cooperatively when the test is designed so that a single animal cannot pass it.
They obviously demonstrate the full range of emotions, to include affection, remorse and mourning, anger, greed, competition and cooperation, play, happiness, fright, bravery and self sacrifice, etc. And while some dogs can learn the meanings and context of some 300 human words, elephants are far beyond that to an unknown degree.
Elephant memories of each other and humans can indeed last decades, and they are known for affectionate reunions.
It might even be said that many elephants are even superior in intellect and emotions to many more primitive humans.
There is so much about the occupants of this mortal coil that we cannot fathom. In general, attempts to use secular science will fail to give us much understanding. Bible theology does better, e.g. “The lion roars, and seeks its food from God” and “a righteous man is kind to his beast.”
The question of whether animal souls go to heaven is a matter of continual speculation. I know nothing from the scriptures that says they can not, and several things seem to hint that they can. It is notable that sin is never ascribed to an animal, save possibly for the “serpent” of the Garden of Eden which might have been a supernatural being, not an ordinary serpent.