Two crowded commuter trains have crashed head-on in Vienna during the morning rush hour injuring 41 people, five of them seriously.

The driver of one train and another person remained in critical condition after the mishap, the emergency services in the Austrian capital said.

Operations on the line had been switched to manual following a technical defect with a shunting switch. Human error has not been ruled out as a possible cause of the crash.

"A train got permission to travel when it should not have," a spokeswoman for Austrian railways said.