In Kim, did Kim and the lama die at the end?
I could be very literary here and say that they do, but not in the sense that you are talking about. Whilst Kim and the lama do not physically die, they do undergo a kind of death in terms of their former selves dying and being left behind and being born into a new identity. Let us just remind ourselves what happens in the final chapter before we look at this further.
In the final chapter, Kim battles a dangerous fever. The old woman of Kulu nurses him and he recovers. Mookerjee takes Kim's documents from him and gives them to the Colonel. Kim at this stage experiences an existential crisis as he asks "I am Kim. What is Kim?" In a moment of epiphany, however, he comes to realise that he is finally able to identify himself as belonging to the human race rather than being estranged from it. The lama narrates to Kim how he has achieved the Enlightenment he was looking for, having an out-of-body experience that enabled him to attain the goal of his Search. The novel ends with his claim that he has gained deliverance from sin for both himself and for Kim.
What is key to realise is that, while both of these central characters do not die in a physical sense, their experiences, in particular as related to us in this final chapter, clearly indicate the way in which they have changed profoundly and in many ways begin new lives as the novel ends. For Kim, he is finally able to feel that he belongs. The lama likewise has finally attained the wisdom and deliverance that he has sought for so long.