I'm so sorry this has happened to you. We just can't say for sure whether there was something that caused it or whether it was just really bad luck. Most people here who lose piggies unexpectedly don't take them in for post-mortem unless they suspect the piggy died of something contagious that might cause problems in their herd (some people have a
lot of pigs). I don't think it was the stress of being handled - it does stress them if they aren't used to it but there would be thousands of piggies suddenly expiring all over the world if it was handling. If they were old-age pigs (say about 5 years) the first may have been natural causes and the second might have been triggered by stress from the first death. But again this is just speculation.
If it helps, take a look at our guide
Human Bereavement - Grieving, coping tips and support links for guinea pig owners and their children
Without meaning to cast aspersions, did your co-worker say why they were being rehomed? I'm wondering if he had seen signs of illness and started to worry about vet bills? It seems you haven't had them very long at all... did you know this person well? I don't want to cause any trouble though.
The fact that they seemed to die in the same way and so close together suggests to me one of two things - either something contagious or something in the environment they were both exposed to. If they had developed some sort of respiratory infection (eg pneumonia) they might struggle to breath and the lungs can fill up with fluid. The 'coughing or hiccupping' can be as they take their final breaths. Or if they had both been allowed to eat something that was actually toxic (certain plants are poisonous for them) - but to be honest a lot of pigs are wary when eating new things so it would seem a bit unlikely, and you would have noticed if they had escaped and eaten a houseplant. It seems a long shot but is there any chance of Carbon Monoxide poisoning? It occasionally happens over in damp Britain - usually in one of our small, houses with old gas boilers - but we only see it on the news if people are involved. However, if your pigs were in an enclosed space near something which uses gas to heat it would be worth checking for your own safety too.
The other thing is if they were outdoor pigs that had been brought inside, or indoor pigs that had been moved outdoors - I don't know what your weather is like there but pigs don't like big changes in temp or humidity and this can make them more susceptible to infections. Over here we say don't let them live where it is less than 15 degrees centigrade... especially if they are used to warmer indoor temperatures it as they won't be thickly furred enough to cope.
Dying piggies can go through a phase of convulsing (sometimes referred to here as 'running to the Rainbow Bridge') but by this point piggy is often not that aware of what is happening. When I've seen this in my pigs they've usually been very visibly ill beforehand - not eating, losing weight, breathing hard, hunched up, hiding away, and you don't mention any of these things. If your pigs were looking well and eating/drinking normally and this tragedy came on suddenly the only thing I can offer is at least they did not suffer for long. I will say that my one piggy that went from fluid on the lungs went downhill and died very fast - within hours - so although I rushed her to the vet for antibiotics we were already too late. This old girl had accidently snuffed in a drop of water while she was being bathed with a medicated shampoo (bathing pigs is not recommended unless for medical care reasons). It can take them very fast.
When you have given yourself time to grieve these recent but much loved family pets you might be considering getting more. The forum contains great guides at the top for new and wannabe owners but one thing I will suggest is that if there is any sort of animal rescue near you it's worth considering asking for piggies there - not only will you be giving surrendered animals a second chance but they should have been completely vet-checked and given a clean bill of health before they come home to you. You will also have the advantage of getting a bonded pair - they are infinitely happier with a friend of their own kind than they are alone. There is another website - guinea lynx - that has more details of US rescues. We have members from all over the world but are UK based. Try looking at
Guinea Lynx :: Rescue Organizations to see if there is anything near you.
Once again, I'm so sorry for your loss. Never let anyone tell you "it was only a guinea pig..." because we all know on here how they make a little piece of your heart their own and so take it with them when they go. They are at peace