The makeshift bomb exploded in a carriage late on Wednesday as policemen inspected it after the train stopped at a station in the province of Menufiya north of the capital.
The train was not heading for Cairo.
The two policemen were killed on the spot while two passengers later succumbed to their wounds, a medical official said in an updated toll.
A bomb later went off in a Cairo metro station, wounding three people.
Another small blast in the capital struck outside the Al-Qubba palace, which is rarely used by President Abdel Fattah al-Sisi, lightly wounding a female passerby.
Dozen of policemen and soldiers have been killed in militant attacks since then-army chief Sisi overthrew Islamist president Mohamed Morsi last year and launched a bloody crackdown on his supporters.
Most of the deadliest attacks have taken place in the Sinai peninsula, where militants killed at least 30 soldiers in one attack last month.
The militants have also expanded their reach into the capital and the Nile Delta, targeting police stations and checkpoints.
Signup to our newsletter and follow us on Facebook and Twitter!
A bomb outside Cairo University on October 22 wounded nine people, including a police general.
Ajnad Misr, a militant group that has killed several policemen in Cairo bombings, claimed that attack, saying in a statement it was in response to repression of student protesters.
The group also claimed responsibility for bombing a checkpoint outside the foreign ministry in September that killed two policeman.
It says the attacks are revenge for the deaths of hundreds of pro-Morsi protesters in clashes with police after his overthrow in July 2013.
At least 15,000 Islamists have been arrested on suspicion of protesting or participating in violence since Morsi's overthrow.
The authorities have blamed Morsi's now blacklisted Muslim Brotherhood for the violence, although the group insists it is committed to peaceful protests.
Sisi has vowed to eradicate the Islamist movement, which continues to hold small protests.
The deadliest bombings have been carried out by Sinai-based militant group Ansar Beit al-Maqdis.
It is believed to be responsible for last month's attack on an army checkpoint that killed at least 30 soldiers, the deadliest in years.
Sisi declared a state of emergency in parts of northern Sinai after that attack, and the military has begun demolishing homes along the Sinai border with Gaza to create a buffer zone.