If all the preliminary precautionary steps (search for the owner, call for the police or emergency services) do not make it possible to urgently resolve the situation which you are witnessing, the law allows you to intervene without risk of criminal prosecution and thus legally breaking the window of the passenger compartment.
Indeed, although the owner of the vehicle whose window has been broken, could file a complaint for damage to his vehicle, article L.122-7 of the Penal Code protects you.
The law provides that a person is not criminally liable who, faced with a present or imminent danger which threatens himself, others or property, performs an act necessary to safeguard the person or property, unless he there is a disproportion between the means employed and the seriousness of the threat.
It is then recommended to intervene in the presence of witnesses and for example after having taken photos demonstrating the situation with which you are confronted.