On older engines, the try cocks were located right on the backhead, but on the K-28's, K-36's and K-37's they are mounted on the water column, along with one of the water glasses. As noted in other posts, this helps to give their readings more stability and reliability.
The reason they were needed is the relative unreliability of water glasses. Anything subtly wrong with a water glass will cause it to read a falsely high level. If a shutoff valve is accidentally left turned off, or either top or bottom pipe of the water glass is plugged with something (usually scale; but at least one locomotive I read about blew up because of a wooden handle from a boiler plug thread dope brush floating into one of the pipes), condensate will cause the water level to rise in the glass. The engineer knew that with the try cocks, if he could SEE water, he HAD water.
In answer to another question, the water glass tubes on the K-28's, K-36's and K-37's are contained inside a "cage" of cast iron and very thick safety glass, equipped with a drain pipe vented below the cab floor. So if a water glass does break, and they occasionally do, the steam is vented safely away. That's in theory: in actual practice, the cab still fills with steam, making it rather exciting to find and close the shutoff valves when a glass breaks as you're jolting down the tracks. But at least I never saw anywone get scalded by one in 15 years.