Rikki-Tikki-Tavi is slavishly devoted to an English family simply because they are English and seem so clean and superior. This brave and loyal mongoose resembles Kipling's Gunga Din, who practically worships the British and loses his life while rescuing one wounded British soldier who tells the story in Kipling's famous poem. I should think that anything Kipling wrote about India could be considered an imperialist text. I don't know whether cobras should be considered symbols of either India or Britain. They exist in the story simply because mongooses are famous for their ability to kill cobras. If anything, the cobras would be symbols of India, since there are no cobras in Britain.