The rains set off flooding and landslides, forcing tens of thousands of people to flee their homes in the capital and neighboring Hebei Province.