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.
Six dead, more than 100 injured in Mexico protest
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 Wednesday, striking just south of Belize's capital. It hit Mexico as a storm on Thursday and eventually weakened to a tropical depression.
Strong 6.2-magnitude quake shakes Mexico
On Sunday, 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 Center said Javier was about 250 miles (405 km) southwest of Cabo San Lucas, Mexico.
"On the forecast track, the center 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 center said.
The storm was packing maximum sustained winds of 50 miles per hour (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.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ