I have also experienced hours of waiting in A&E with an elderly mum with dementia - my record is 13 hours! She was only supposed to be there to have an x ray of her hip as the district nurse was concerned about a lump but it was as if she was held hostage for a week!
We had already agreed with her GP and care home staff that she would no go to hospital again as mum was in a cycle of refusing to eat or drink, getting dehydrated and infections needing IV antibiotics and fluids, improving slightly, going back to her care home only to refuse to drink again!
Every time she went in hospital, she acquired bed sores through not being turned or helped out of bed and became fully incontinent as she was not taken to the bathroom. The last time I got so stroppy with the medical staff about their refusal to discharge her despite the letter on her medical records about no more treatment and desire for end of life care in the care home that I was banned from phoning again ( no visits allowed as there were still Covid restrictions)
Finally, after I involved PALS and the Senior Dementia Matron, mum was discharged but never really recovered from her ordeal and died five weeks later at the end of March. My sister is convinced she chose to die by refusing food and drink, I’m not so sure, but as the GP supported our decision for no further treatment and offered EOL support through district nurses, mums last few weeks were very peaceful. Even so, after the GP was called because mum had become very ill overnight, I was still asked if I wanted her to go to hospital for investigations, I had to confirm that I was withdrawing treatment which was very upsetting but totally the right decision.
It sounds like your mum is not quite so advanced as mine was but as she weakens, you should have more control of where she spends her final few days. A hospital ward is not always the best place for elderly people with dementia to be for EOL and district nurses are available to provide medical support. My mum did not need to sedatives prescribed by the GP, she died before the district nurse came but had she needed them, they were ready at the care home.
I hope you can ensure that your mum has a peaceful life at this stage, it’s very hard though and I am still recovering from the emotional stress of making the decisions although I was fortunate to have very close siblings who were in total agreement.