A total of 28 died in central Puebla state, at least 15 of them minors, as landslides buried several houses, the state government said.
The other 10 died in similar circumstances in the eastern state of Veracruz, its governor said.
In the town of Huauchinango, the amount of rain that normally falls in a month came pouring down in just 24 hours, the Puebla government said.
A hill crumbled and came sweeping down on an adjacent village, killing 11 people including eight minors, it said.
Several highways in Puebla were ripped up, two bridges collapsed and power was knocked out in several towns.
Governor Rafael Moreno Valle pledged to rebuild damaged structures and posted on Twitter photos of himself walking in mud and residents helping in clean up efforts.
Some 200 people were left homeless in Puebla by the torrential rains, while in Veracruz rivers swelled with rainwater and dozens of families were evacuated.
Earl swept in from the Caribbean at hurricane strength last Wednesday (Aug 3), striking just south of Belize’s capital. It hit Mexico as a storm on Thursday (Aug 4)and eventually weakened to a tropical depression.
Yesterday, however, it was approaching Tropical Storm Javier that was sparking new warnings. It was expected to bring heavy rains and high winds to southwestern Mexico in the coming days, US weather forecasters said.
The Miami-based National Hurricane Centre said Javier was about 405 km southwest of Cabo San Lucas, Mexico.
“On the forecast track, the centre of the tropical cyclone should pass near or over the southwest coast of Mexico later today, and approach the southern portion of the Baja California peninsula on Monday,” the centre said.
The storm was packing maximum sustained winds of 85 km/h with higher gusts and was expected to dump four to six inches of rain in western Mexico, it said.
Another tropical storm, Ivette, also was swirling in the eastern Pacific, but it was far from land and expected to weaken later in the day, according to the NHC.