The government in Kerala state had imposed the ban on August 11 after claims by a New Delhi-based environmental group, but the Kerala High Court ruled on Friday that the state government did not have the authority to do so.
Chief justice VK Bali and justice M Ramachandran said in their ruling: "The ban order issued by the state government was not within the legal powers that rest with the government. Thus we set aside the government order."
The cola companies, both of which have bottling plants in the state, welcomed the order.
Coca-Cola said: "This order protects the interests of big and small retailers, local entrepreneurs and employees which have been affected by this illegal ban."
Five more of India's 29 states have banned or restricted the sale of Coke and Pepsi after the pesticides claim was made in early August.
Coca-Cola said it hoped that other state governments would reconsider similar orders.
The rivals, who account for 99 per cent of India's soft drinks market, have insisted that their locally bottled drinks meet international safety standards.
Both Indian and US business leaders have said that the controversy could tarnish India's investment image abroad, and earlier this month the United States sent a letter to the Indian government urging fair treatment for PepsiCo and Coca-Cola.
Anti-cola activists in the state, however, said they would continue their campaign against the multinationals. Kerala residents say a Coca-Cola plant in the state was causing pollution and had depleted ground water supplies.