They might have been charged with manslaughter or second degree murder but would plead innocent with a reason of self-defense. The boys were waylaid by the Soc who have been drinking. He was the one who beat Johnny so badly before that Johnny's emotional state was damaged. The Soc was holding Ponyboy underwater in the fountain, nearly drowning him. Johnny's action of stabbing the boy saved Ponyboy's life. A lawyer with any sense would plead self-defense or even insanity in Johnny's case. A prosecutor might claim that Johnny killed him as a payback for the previous beating. I believe that with testimony from Cherry and Darry, that line of argument wouldn't hold up.
Johnny and Ponyboy should not be charged with murder or manslaughter, however, given their social status and economic situations, they probably would have. I agree that any decent lawyer would have claimed self-defense, if the girls had the courage to testify in court, this defense would have held. I often wonder, given the place and time, if any lawyer would have done so and if the girls would have willingly stood up for them. Money and social status are often strong elements that impact legal outcomes for this setting.
Johnny and Ponyboy shouldn't be charged for either. They killed Bob due to self-defense in the park. The police or the judge would probably would have charged them due to the fact that they are Greasers and just killed a Socs.