Question about building a query

I want to filter an train station which has an river in the radius of 10m and the train station also has a school which is in the radius of 500m. Is there any method to build a query to filter the results?

Many Thanks

Yes, see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Banks_far_away_from_police_stations https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Highway_around_schools_with_inappropriate_maxspeed_(since_0.7.54) for hints