By Amy Sawitta Lefevre and Andrew R.C. Marshall

PHRAE/BANGKOK, Thailand (Reuters) - When former Prime Minister Yingluck Shinawatra arrived in this sleepy corner of northern Thailand and flashed her familiar smile, waiting supporters gasped and spoke of a political revival.

But as she cradled babies, hugged grannies and posed for selfies in Phrae province, Yingluck was also thinking of political survival, say aides.

In the two years since the military overthrew her government, Yingluck has been on trial for corruption over a multi-million-dollar rice subsidy scheme. She denies wrongdoing and faces up to 10 years in prison if convicted.

Phrae was one stop in a series of provincial trips aimed at keeping Yingluck, Thailand's first female prime minister, in the public eye and making the junta think twice about jailing her.

"It's a fight for survival," Chayika Wongnapachant, her niece and aide, told Reuters.

The trips take place in the run-up to an August referendum on a new draft constitution that critics say will stymie party politics and enshrine military power.

The junta has threatened to jail anyone campaigning against the constitution, which is meant to pave the way for a general election in 2017.

Yingluck cannot run because the junta banned her from politics for five years, but her star appeal would boost any campaign by her Puea Thai Party.

THAILAND'S WIDER DYSFUNCTION

However, many Thais despise Yingluck almost as much as her billionaire brother Thaksin, who was prime minister until deposed in a previous military coup in 2006.

Both his supporters and opponents have taken to the streets in a decade of often-violent protests.

Thailand remains broadly divided, with the Shinawatra clan enjoying heavy support in the mostly poorer north and northeast.

Yingluck's resilience and popularity is a symptom of Thailand's wider dysfunction, says Thitinan Pongsudhirak, a political analyst at Bangkok's Chulalongkorn University.

"She can't run in the next election yet remains a leading newsmaker among politicians because her opponents have failed to provide a viable electoral alternative," he said. "The military government would like Yingluck to go away and the Thaksin era to be extinguished."

The opposite Democrat Party remains weak and the junta still struggles for legitimacy after two years in power, he said. "So Thailand really is in this prolonged limbo."

POPULARITY CONTEST

Ostensibly, Yingluck's tour of the countryside came after she asked her five million Facebook followers to name tourist attractions in their home provinces, and to cast votes for the five she should visit. But the trips are also an attempt to "test the waters", Chayika said.

The junta, which banned gatherings of five or more people after the 2014 coup, has made no public objection to what look and feel like political rallies.

"The junta cannot stop her from doing so because when she goes there are no problems," government spokesman Colonel Winthai Suvaree said of Yingluck's trips. "But every time she goes, one of our officials will follow her and send reports back to us."

The government was also being cautious, said Suranand Vejjajiva, Yingluck's former chief of staff. "The public might rebel if they think she is being treated unfairly," he said.

Yingluck's trips have become part of an intensifying popularity contest with the army general who deposed her: Prime Minister Prayuth Chan-ocha.

Yingluck's relaxed style in Phrae contrasts with Prayuth's tetchy public appearances. He has lashed out at reporters, vowing in 2015 to "execute" those who didn't report the truth.

At a recent event promoting fitness, Prayuth wrapped a scarf around a gym instructor's neck and pretended to hang him.

LETHAL BEAUTY

August's referendum on the draft constitution will also be the first real test of the junta's popularity since the coup.

Both Yingluck's Puea Thai Party and the Democrat Party say the draft constitution is undemocratic and will do little to soothe Thailand's political instability.

Despite the junta's threat to jail critics of the charter, Yingluck used her trip to Phrae to inject a note of doubt.

"I'm worried about the constitution and that it will lead us nowhere," she said after a tour of two picturesque Buddhist temples. "I would like a constitution that ... gives maximum rights to the people."

Critics have accused Yingluck of playing on a "soft" feminine side and turning on the tears to elicit sympathy. In private, however, she is forceful and eloquent.

"Do you know the Thai phrase suay prahan?" asked her niece Chayika. "It means 'lethal beauty'." Then she drew her finger across her throat.

(Additional reporting by Aukkarapon Niyomyat; Editing by Bill Tarrant)