PALU, Indonesia—Nurdiyah Rasid was performing evening prayers near the beach here when she felt the earthquake hit at dusk on Friday. She stumbled out of the mosque to see water from an adjacent canal being sucked out to sea.

Minutes later it surged back, she said—part of a powerful tsunami that pounded the shore before surging inland.

“We...