At least 25 people have been killed and about 40 injured after a passenger train collided with a stationary goods train in southern India, a local railway official said.

The passenger train was travelling to Bangalore, the capital of Karnataka state, when it rammed into the goods train at Penneconda station in the neighbouring state of Andhra Pradesh on Tuesday.

GK Jalan, the railways' regional public relations officer, told the AFP news agency that among the victims were two women and a child.

He said three coaches of Hampi Express overturned after the collision.

The accident occurred before dawn, said Chandralekha Mukherjee, executive director for information at the railways ministry in New Delhi.

"It appears that the driver of the passenger train overshot a signal, and hit the goods train, but we are awaiting the results of an inquiry," Mukherjee told AFP.

Rescue workers and medical officials worked through the early hours to pull out all those trapped inside the overturned carriages.

"There is no one trapped inside now," Mukherjee said.

India's rail network is still the main form of long-distance travel in the country despite fierce competition from private airlines.

The last major train accident in India occurred in July last year when a packed express train travelling from the eastern Indian city of Kolkata to New Delhi derailed at high speed in the state of Uttar Pradesh, killing 69 people.

India's worst rail accident was in 1981 when a train plunged into a river in the eastern state of Bihar, killing an estimated 800 people.

Source: Agencies