I think it depends on Sri Lanka's needs - ie, how much electricity it needs. If it needs a lot, then investing in power plants and techonology and research would be a good idea. OTOH, if it's needs are modest compared to India's, then it makes more economic sense to import it from India and let India make all the investment required.
Compare it to the defence industry, for example - it doesn't make any sense for SL to develop a huge military industrial complex and develop and manufacture helicopters and fighters and tanks - it is much more economical to buy from abroad, since the volume needed is low. OTOH, for India it is the oppposite - developing our own defence industries can save us a lot of money, since we need thousands of aircrafts and helicopters, and any money invested into building an industry will be more than worth it.
In power, India is set to increase its generation manyfold, especially nuclear power. It might be cheaper for SL to ride on India's tailcoat and not duplicate the massive initial investments required. It depends on the numbers, of course.
In any case, how is it a security risk? India and SL are going to have friendly relations for a long time to come. And in the unlikely eventt of hostilities with India, loss of power should be the last thing for SL to worry about.