A federal bankruptcy court judge in Boston approved Stewart Healthcare's plan to shut down two of its hospitals in the Bay State, Kearney Hospital in Dorchester and Neshoba Valley Medical Center in Ayer, by the end of August.