After drinking a bunch of water a chicken can have water flow back out of mouth by putting its head down or from pressure on the crop. They can't control keeping things contained in the crop it can come back up and interfer with breathing causing them to gag or cough to clear the airway. Some can even sneeze to clear the fluid from nostrils.
I have accidentally denied my chickens water and have seen this happen when they drink quite a bit of water at once. Was a waterer they would jump on the top of then when jumping off they knocked it over and were out of water for 4 hours on a hot day. I felt terrible! I had to secure the waterer and made a cone from a plastic jug so they could no longer land on top of it.
Keep an eye on them for continued signs of having aspirated water, mine cleared up the coughing sneezing the same day within hours. Water could cause breathing problems similar to us getting bronchitis or pneumonia and if rattling breathing for prolonged amounrt of time could be time for a Vet visit. Could try Tylan50 to help if has become a respiratory infection. Will need to be isolated for care.
I hope more experienced people will give more advice.
Good luck!