OMG how awful.
Learning how to do 'rat phone' is a must. You just pick up the rat and hold her sides to your ears and listen for clicks and congestion sounds. Now sometimes rats do get congested and it's not an infection but it's always better to be safe than sorry. Trust me, it cost me 320.00 dollars one night to find out that both my congested rats were totally fine. Boy, that was a kick in the bank account!
If she's fuzzed up (piloerection), not eating or drinking, lethargic, has congestion sounds, then it's time to go to ER.
Most ER vets don't have any knowledge of rats. They are simply a stop gap until you can see your rat vet. They are quite the expensive stop gap but they will try their best to keep your pet alive and comfortable until they can see the rat vet.
Unfortunately, rats can develop respiratory problems VERY fast and can die from them quickly and they can be very good at hiding symptoms. However, it could've been a stroke or a heart attack and so don't blame yourself. Sometimes these things happen. You can learn from these things and gain knowledge. It's so hard when a rat suddenly passes like that. I've been through it as have most everyone on this forum. You had a rat you loved and cared for to your utmost ability and that's all anyone can ask. Think of all the good things you gave her and the beautiful life she lived. She is not in any pain now. She is at peace.
You can get a necropsy performed to find the cause. Shadow the rat sometimes does this with her rats.
You're in our thoughts.