Is Brooklyn safe late at night

If you're really worried about safety on the A train (it is not an issue but if you're worried...) the LIRR is a good option.

There are generally at least two LIRR trains an hour and these are commuter trains carrying people to the 'burbs. It is faster but more expensive. The off-peak fare is $6.25 and the JFK AirTrain is $5.00. Your hotel might have a shuttle that would pick you up from the Lefferts Blvd. station on the A and you can give the driver a $5.00 tip (make him very happy) and save yourselves all this extra rail fare. It may be worth checking with the hotel.

The train is safe. I've heard a few people comment that the passengers on the train include a very very diverse demographic and I'd say that is true. New York City is a very diverse place. I think the difference between New York and many other places is that we all seem to get along in NYC. Most crime seems to occur among people that know one another. Otherwise people have their iPhones stolen once in a while but the days of tourists getting attacked and beaten in the subways is so very very 20+ years ago. That stuff really only happens on TV.

I'd say that if you are really worried, simply don't pull out your electronic gadgets on the subway (but I am on my Blackberry constantly - nobody wants a Blackberry though - they want the iPhone)