Transport Minister Michael Kamau, who was at the scene, told journalists that six injured had so far been taken to hospital.
"We have rescued six people, most of them were crying out from the structures that were crushed and they couldn't move, but we managed to dig out and rescue them," said Johnson Maina of the fire service department.
Local people suggested casualties may be lower than initially feared as most of those whose houses were destroyed appear not to have been at home when the accident happened, having either left for church or gone back to their villages for the Christmas holidays.
"The initial report is that people are feared trapped, but so far we have not received reports of any actual missing persons," a Red Cross emergency officer at the scene told AFP.
More From This Section
The Red Cross had earlier said that "scores were feared trapped".
"We are thankful for the swift effort in rescuing people, it is by luck that it did not happen at night when people are sleeping. We could have a huge disaster here," said Mercline Akelo who sells fish just next to the rail line.
"The rescue efforts are underway, we cannot talk of the number of those injured at the moment," Nairobi Police chief Benson Kibue told AFP.
One of Africa's largest slums, Kibera's tin-roofed shacks are home to an estimated quarter of a million people, according to an NGO that carried out a population study there.
Kamau said the government has long warned the residents of Kibera not to put up houses right next to the railway, which crosses the settlement.