Either one would work, though you'd get more house for your money in Fdale. I looked on MLS with your price point and saw splanches, high ranches, splits, etc. 500K in East Meadow school district will get you into a ranch or a cape.
EM is a very diverse, family-oriented area. The school district is large, with 5 elementary schools, two middle schools, and two high schools. Both of them are ranked well.
https://www.greatschools.org/new-yor...hool-district/
Farmingdale has fewer schools but they're larger than EM. It's another district that covers a large area, and also ranked well.
https://www.greatschools.org/new-yor...hool-district/ There's a village area with some shopping and a few bars.
When you house hunt, search by school district instead of town name. There are whole sections of Massapequa that go to Farmingdale schools and the neighborhoods are lovely. There are pieces of Levittown and Westbury that go to East Meadow schools and these neighborhoods are great too.
There's no train station in EM, but they're between 3 - Bellmore, Merrick, and Westbury train. If you get a ride, you can go out of Hicksville too (just can't park). Drive 5 minutes in any direction and you hit a highway. It's very accessible.
Farmingdale has a train station but it's a longer drive into the city. The town is further east and only accessible to the Southern State Pkwy.
Taxes seem to be higher in Farmingdale than East Meadow, but it's a case by case basis. Figure out a monthly payment that you can afford rather than a hard sales price / tax cutoff.
Good luck!