NEW YORK — As heavy rain swept through the tri-state area, subway platforms — and in some cases, even the sidewalks and steps leading to them — flooded, creating a dangerous headache for commuters.

And the worst is likely still yet-to-come, with Tropical Storm Elsa headed up the coast.

Some New York City roadways and subway stations temporarily became bodies of water after the deluge of rainfall flooded traffic lanes and station platforms.

Straphangers posted videos of the underground mess.

In some cases, water cascaded from above down onto subway platforms and tracks.

Stairs turned to waterfalls.

Local leaders slammed the infrastructure failings.

Brad Lander, likely the next New York City comptroller, said the city’s “infrastructure is not ready for the climate crisis.”

He wasn’t alone.

The troubling scenes come as legislators battle over infrastructure spending in Washington.

MTA officials said crews were addressing the situation.

Flood waters had receded in many stations by late Thursday evening.

The water issues weren’t just below ground, either. Some drivers on the Major Deegan Expressway in the Bronx needed emergency assistance when the water got too deep on one side of the road.

Other roadways also suffered from flooding, snarling traffic in many parts of the area.

The first showers in our area associated with Elsa moved in as early as Thursday afternoon, with more scattered thunderstorms likely into the evening.

The brunt of Elsa’s rain and wind will sweep through the tri-state region during the overnight hours and into Friday morning.

This is the period when torrential downpours could develop, leading to possible flash flooding on roadways in our area. Local rivers and streams could end up overflowing before sunrise, as well.