You are referring to a technique called anthropomorphism, which is "Attribution of human motivation, characteristics, or behavior to inanimate objects, animals, or natural phenomena." The animal characters in "Rikki Tikki Tavi" display a whole range of human emotions, characteristics, and actions.
Rikki's tendency to investigate every place and everything in the house and garden is not unusual behavior for a mongoose. However, Rikki would not be thinking to himself as he explored,
There are more things to find out about in this house,'' he said to himself, "than all my family could find out in all their lives. I shall certainly stay and find out.
While a baby mongoose may learn some things by observing and imitating the adults in the area, Rikki's mother did not literally tell Rikki "what to do if ever he came across white men."
In the same way, Chuchundra the muskrat doesn't actually follow any thinking process as he is "trying to make up his mind to run into the middle of the room." Nag and Nagina don't talk to each other or consciously plan strategy to kill the man, or Rikki.