In terms of duty of care, I very much doubt that a court would find her negligent. Realistically, if people are able to steal things from the counter in front of the owner of a shop, there is only so much you can do to guard a bag on a train, short of actually sitting on it, and then you can damage it instead. In such situations, all you can do is taking a balanced approach and hope for the best. So the fact that it was stolen does not prove carelessness, even if the OP is blaming herself. We are now at risk of blaming the victim of a crime for the fact that the crime took place: scary!
The 2nd bag wasn't hers so she had no reason to access it during the journey and would not have been on her lap. It is possible that BOTH bags were on an overhead rack or vestibule rack and, at the end of the journey, the OP got up, saw her bag, picked it up and left. If the friend's bag had already been taken, then it was not next to her bag and this would explain why she didn't pick it up when leaving the train.
The fact that she remembered her own bag before remembering her friend's is not necessarily an indicator of not treating her friend's bag with the same care as her own. If someone is used to carrying a handbag, then it becomes an extra limb and is almost impossible to forget as it feels weird to walk without it. So it is the extra item that gets forgotten, not your own bag. That's why people are always forgetting umbrellas: they are an extra item we aren't expecting to carry.
I further think it is relevant that the favour was to deliver the bag as an incidental extra on top of a journey she was already making. This makes it much easier for her to forget it. Had the OP been travelling for the sole purpose of delivering the bag, she probably would not have left the train without taking the bag, if, of course, the bag hadn't already been stolen by then.
Putting myself in a similar position, I once went to visit a friend and decided to take her some old curtains of mine she wanted to use for something. I left them behind on the coach because the purpose of the journey was to visit a friend as I had done many times and I didn't usually carry a bag of curtains. Had I been making the journey specifically to deliver the curtains, they would have been less likely to slip my mind. (Exactly as the OP did, I went back for them minutes later: fortunately, they were still there).