The colonel, a traffic police district commander, and the conscript, who was driving, died in their car after coming under fire by the unknown assailants, the ministry said.
Islamic State group militants have claimed credit in the past for similar attacks in the capital and the Sinai Peninsula, where their insurgency is based.
The militants have killed hundreds of soldiers and policemen since the military toppled Islamist president Mohamed Morsi in 2013 and cracked down on his followers.