I don't think "locking her away for a long time" will necessarily be the most useful option on the table.
She may need to be in a secure environment, perhaps even long term. It depends on how ill she is, how well her illness responds to medication and what support can built into her life to make sure she is best placed to maintain any mental stability that can be created.
I feel for the mother. Heart and soul. That is a deeply traumatic event at a time when a woman can already be at a low ebb and prone to anxiety. In her shoes I would be beside myself. However my limitless sympathy for her does not require the throwing under a bus of somebody who is quite possibly one more person failed by "couldn't give a fuck in the community" and ever shrinking MH services that simply cannot cope with the demands placed upon it.
The reality is that if instead of going all "lock 'em up" people responded with the same degree of revulsion and anger towards the successive governments that have decimated MH services ... there could well be fewer incidents that cause such pain to the victims and such a sense of an unpredictable, scary world to observers.
Not to mention fewer people with MH issues being left to fend for themselves when they are in no fit state to do so.
I'm not saying don't react with anger, outrage and horror. Those are perfectly natural reactions to something as terrifying and random as this. But any chance of a solution that reduces the potential for such events requires those strong feelings to be channelled towards those who chose to prioritise health service savings over the wellbeing and safety of the mentally ill and the general public who encounters the small minority that are a danger to others, rather than just themselves.