Unfortunately, most of the time being close to a subway means you are going to have to sacrifice living in a safe neighborhood. That doesnt mean you can live next to a subway & in a relatively safe neighborhood.
Bay ridge is a safe neighborhood & you have access to the R train along 4 ave, but how comfortable will you be there? Bay Ridge is mostly a white neighborhood.
Now in the North Bronx (e.g. Baychester, Wakefield, Eastchester & Parkchester) are very safe neighborhoods & they are black neighborhoods. Depending on where you live in these neighborhoods, you may have a bit harder time getting subway access, but most of those neighborhoods have good access to the 2 & 5 trains.
Me being a white person I've never had a problem feeling uncomfortable walking around in black neighborhoods. However, there was one time I walked down 125 St in Harlem & all the people there were playing the "you dont exist game" & kept walking into me on purpose.
As for public school's in these areas I'm not sure, but I think they are somewhat below city average, but the Bronx is the cheapest Borough to live in.
If you need any more help I will do my best to help you & good luck! Hope you'll like it here!