I know this thread should come to a close but perhaps its time to find a cage with 1/2" spacing between the bars. 1/2" wont stop mice from entering the cage but it will stop adult rats from entering a birds cage. I am not sure what country you live in, you said this was an indian rat, so I assume you may live there? Sorry for the presumption if I am wrong. Are there big enough cages where you are from that a 1/2" cage bar spaced cage will be big enough for a cockatiel. You may have to import one to your country that is suitable (large and 1/2" bar space). Might also want to relocate the cage somewhere in your home that will be safer.
Where do you think the rat came in from?
Im glad it is finally gone
But as other's have said, if there is one there will be more. I work with mice daily (part of my work) and I adore them. I adore rats. Both mice and rats make excellent pets. However, I have had wild mice attack and kill my pet baby birds before when I was 13 years old and I was devastated. I was so darn sad. I have killed and would kill wild mice or rats that came into my home if I could not relocate them. With that said, a friend of mine even used glue traps and we rescued the poor mice from them and released them a block or two away when we were teens. So you do what you have to do and sometimes your heart will help you along the right path.