Across Indonesia, people rely on Mr. Sutopo when a disaster strikes.

“He explains things in simple language for average people,” said Caroline Maringka, a store manager in Jakarta. “I also feel he is very committed and puts the public’s interest on top. Even though he is suffering from a terminal illness, he still does his job.”

Despite his condition, Mr. Sutopo was upbeat and vigorous during a two-hour interview.

The father of two children, ages 12 and 19, he said he was taking morphine for pain, including an aching spine. Lying down is so painful that he rarely sleeps more than three hours a night.

He posts often about his condition on Twitter, sharing X-rays of his lung and before-and-after photos of the top of his bald head, showing that some hair, oddly, has grown back during chemotherapy.

Pak Topo, as he is affectionately known, grew up in the Central Java town of Boyolali, about 330 miles east of Jakarta and close to Mount Merapi, one of Indonesia’s many active volcanoes. He studied geography at university and later earned a doctorate in natural resources and environmental management.

For 16 years, he worked for government agencies as a researcher, mainly on water issues. After a dam broke near Jakarta in 2009, killing more than 100 people, he analyzed photos of the dam and went public with his finding that cracks in the structure had caused it to fail.

“It was me against the Ministry of Public Works,” he said. “At that time, I received a lot of threats to keep quiet.”

Even so, he was asked to take a leading role in analyzing and explaining subsequent disasters.

He turned down his current post three times, he said, because he did not want a job in which he thought his role would be to promote his boss.