When you say 'humans can not smell when they have water trapped in their noses', I believe you mean the loss of the sense of scent caused due to nasal congestion, which is due to inflammation, blocking the scent receptors in the nasal cavity (any mechanical blockage preventing odours from reaching the olfactory nerves can cause a loss of sense of smell. This blockage can be due to inflammatory processes like simple infections causing mucus plugs or nasal polyps(1)). Since the basic structure of the respiratory tract is similar in mammals, mucous plugs reduce scent sensitivity in elephants as well.
Olfaction occurs when odourants bind to specific sites on olfactory receptors located in the nasal cavity. They get into the nasal cavity when you breathe or sniff the air.
Molecules of odourants passing through the superior nasal concha of the nasal passages dissolve in the mucus that lines the superior portion of the cavity and are detected by olfactory receptors on the dendrites of the olfactory sensory neurons. 978
This mucus acts as a solvent for odour molecules, flows constantly, and is replaced approximately every ten minutes. ...(2)
(Thanks to @Adhish for the above point.)
If the water itself has a scent, then, as @KaPy3141 pointed out, it can be distinguished because it is in contact with the olfactory receptors. Scent of anything else outside cannot be determined, because they do not reach the receptors.
Elephant lungs are attached directly to the diaphragm and chest wall, allowing them to create much greater "vacuum pressure" for sucking water through their long trunks, while drinking.(3) To open its mouth to breathe would cause the loss of the low pressure and the water column would expelled. So the water column must first be transferred to the mouth, then swallowed before breathing can recommence.(4) Thus, as far as respiration is concerned, they cannot breathe when the trunk contains a column of water, and, as a result, odourants cannot enter the nasal cavity, and elephants cannot smell in this case.
1-https://www.ncbi.nlm.nih.gov/books/NBK482152/
2-https://en.wikipedia.org/wiki/Olfaction
3-https://www.elephant.se/elephant_lungs.php?open=Elephant%20anatomy
4-https://www.quora.com/How-do-elephants-breathe-when-drinking-water 978