A forest of eucalyptus columns extends inside the expansive dormitory complex of the Canuanã school in northern Brazil, as if the nearby woodland has taken over the building. Between the soaring trunks stand clusters of little mud-brick rooms arranged around open courtyards, while a wafer-thin metal canopy floats above the whole scene, providing merciful shade in the sweltering heat.

This is the Children Village, designed by young architects Aleph Zero with designer Marcelo Rosenbaum, named this year’s winner of the RIBA international prize for the best building in the world. It is an unlikely accolade to find bestowed on a remote school in a far-flung part of Brazil, designed by a duo in their early 30s who had built little more than a couple of private houses and a few installations before landing this commission.

Perforated, breathable walls allow natural cross-ventilation. … Children Village. Photograph: Leonardo Finotti/Rosenbaum Arquitetura 2017

“We chose the architects precisely because they are not the kind who think they know everything,” says Denise Aguiar, director of the Bradesco Foundation, the charitable arm of one of Brazil’s largest banks, which originally built the school in the 1970s and operates 40 such schools across the country. “We didn’t know what we needed, but the designers seemed like they would actually listen to what the students wanted rather than imposing their own ideas.”

The project began with an intensive 10-day residency on site, when the architects met with some of the 540 teenagers they would be designing for, developing games and workshops to understand how the students wanted to live together. The institution is a boarding school by necessity: it serves the remote agricultural region around the municipality of Formoso do Araguaia, where pupils travel lengthy journeys by horse along unpaved roads to get there. The isolation made construction a challenge, too.

The new home provides rooms for six, arranged around beautifully landscaped courtyards … Children Village. Photograph: Leonardo Finotti/Rosenbaum Arquitetura 2017

“We could only transport light materials to the site, so we prefabricated the timber frame elements, but decided the heavy materials must come from the place itself,” says Gustavo Utrabo, who founded Aleph Zero with his former classmate Pedro Duschenes in 2012. Speaking on the phone from their studio in São Paulo, he adds: “The challenge was to convince the students and teachers that the local materials of earth, bricks and timber could represent progress – that being modern didn’t have to mean glass, steel and air-conditioning.”

Thankfully, Aleph Zero succeeded. The resulting complex is a model of light-touch environmental design, providing a huge expanse of shade, beneath which clusters of small buildings are arranged, with perforated, breathable walls, allowing natural cross-ventilation. No air conditioning is needed, even in 45C heat. The only complaint students have made is actually being cold at night, an issue easily solved with more blankets.

“The main aim of the design was to make a place that feels like a home from home for the kids,” says Utrabo. Their former digs consisted of overcrowded barracks, sometimes sleeping 40 to a room. The new home provides rooms for six in wooden bunkbeds, arranged around beautifully landscaped courtyards, connected by an upper level of wooden walkways and play areas, creating an airy veranda with the feeling of a meandering tree fort. There are two identical buildings, one for boys, one for girls, each stretching 165 metres x 65 metres either side of the school, now being used in very different ways.

The buildings have taken on a life of their own … Children Village. Photograph: Leonardo Finotti/Rosenbaum Arquitetura | 2017

“The girls are getting much more friendly with each other,” says Aguiar. “They told me they can now share their secrets, because they’re living in cosy groups of six, not 40. They enjoy spending time in their rooms, whereas the boys spend all their time playing games on their upper decks.”

Utrabo revisited the project a couple of weeks ago to find the buildings have taken on a life of their own. The girls have started organising pilates classes, which they never had the space to do before, while those forced to resit exams can now have extra tuition in the less formal surrounds of the village, rather than having to go back to school after hours.

The project is the second recipient of the RIBA’s biennial international prize, and it continues a Latin American educational theme. The prize was first awarded to Grafton’s majestic concrete campus for UTEC university in Lima, Peru, in 2016. Billed as the world’s most rigorous architecture awards, the process saw a jury visit a long-list of 30 buildings around the world, before a “grand jury”, this year chaired by Liz Diller, visited the shortlist of four finalists. The Children Village beat off competition from O’Donnell & Tuomey’s building for the Central European University in Budapest (now threatened with closure by the country’s rightwing government), Toho Gakuen School of Music in Tokyo by Nikken Sekkei and the tree-covered apartment towers of the Bosco Verticale in Milan, by Stefano Boeri.