CAIRO — A speeding train barreled into Cairo’s main railway station on Wednesday, crashing into a platform and setting off a fireball that swept through the crowded station, leaving at least 20 people dead and dozens injured, officials said.

Surveillance footage from the station that circulated on social media, showing the crash and graphic images of passengers engulfed in flames, fanned public outrage at the latest disaster on Egypt’s dilapidated and accident-prone rail network.

Hours later, Egypt’s transport minister, Hisham Arafat, resigned. The crash will renew scrutiny of the priorities of President Abdel Fattah el-Sisi, who has promoted sweeping national projects but failed to halt a slide in public services like health, education and transport.

Footage from one surveillance camera at Cairo’s Ramses station showed a locomotive hurtling past a busy platform, ramming a barrier and setting off an explosion that engulfed the station in flames and smoke.