By Agence France-Presse
Land ownership is one of the most contentious issues in the formerly junta-run country, where the army stands accused of rampant land-grabbing during its 50-year rule.
In recent years democratic reforms and the end of Western sanctions have fuelled a scramble for territory and brought a flurry of old conflicts to the fore.
The latest case revolves around 70 acres (28 hectares) of land, which 24 farmers say was seized from them by a military security unit in 2001 with little compensation.
For years the farmers continued to grow their crops undisturbed, but in August last year the military tried to fence off the confiscated land.
When the farmers protested last week they were arrested, charged with trespassing and destroying property and sent to Mandalay's notorious Obo Prison.
"In all 24 farmers were sued by the local authorities," their lawyer San Nyunt Wai told AFP before the court hearing outside Mandalay.
"Now 21 farmers are in prison as they cannot get bail," he said, adding that three others were released because they face different charges.
Most land seizures in Myanmar date from the 1990s and early 2000s, when the country was undergoing a messy transition from its own brand of junta-controlled socialism to a more market-driven model.
Activists say most of the land was grabbed by military officers and their cronies, and then large tracts of it were loaned to private companies to be cultivated.
A Global Witness report found that as of 2013, 5.3 million acres had been leased to investors for commercial agriculture, "the majority without the consent of its owners".
Few farmers have documents to prove they have any rights to the land. Those who do often end up mired in a complex and opaque system with little hope of redress.
A commission set up in 2013 to address land-grabs has only dealt with a tiny fraction of the tens of thousands of cases across the country.
The new elected government has said addressing land conflicts is a priority but has done little since it came to power in March.
Legal rights group Namati said those rare farmers who win compensation often only receive a tenth of what the land is worth.
The bail hearing was continuing.