The attacked happened at about 11 pm on Saturday at Windsor Crescent in Cookstown, CoTyrone.
The boys were standing outside a house when they were approached and attacked by the masked men.
One of the teenagers suffered a swollen cheek and a cut to his lip. The men made off on foot across nearby playing fields.
Police have appealed for witnesses.