The stowaways waved to alert passing motorists who flagged down the HGV driver to stop on the A22 in East Grinstead on Saturday morning.
Immigration enforcement officers found people who said they came from Iraq, Syria and Iran. A male and a female were taken to hospital with dehydration, but were later discharged.
Once immigration officers arrived, they used nearby Trinity Methodist Church as a refuge centre.
Sussex Police said those who did not need hospital treatment were given water and medical aid.
Sergeant William Keating-Jones of Sussex Police said the welfare of the immigrants was their first priority due to hot temperatures.
He thanked those who made it possible to respond quickly.
He said: "This was a great multi-agency response to a potentially life-threatening situation, with emergency services, immigration officials, volunteers and even local residents all pulling together.
A 63-year-old man has been arrested on suspicion of facilitating illegal immigration.