Four people - including a 12-year-old boy - have been charged with lighting fires in Sydney on a total fire ban day.

Police say they arrested two boys at about 2:30pm (AEDT) yesterday, after a fire near the M5 motorway in Eagle Vale burnt through two hectares of grassland behind homes.

The boys aged 12 and 17 were taken to Macquarie Fields Police Station, and charged with sparking the blaze.

The 17-year-old will face Campbelltown Children's Court today, while the younger boy will appear in court next month.

Earlier yesterday two men were charged over a fire that started in a park at Tregear near Mt Druitt yesterday morning.

Officers say the men lit leaves and sticks before throwing an aerosol can in the flames.

They will face Penrith court, charged with setting crown land alight and disobeying a total fire ban.