Right, but wehat you detect is the eye colour, not the genes that cause it. Similarly with the rats they detect the pheromones in a male's smell, not the XY chromosomes. So suggesting they detect the XY chromosomes isn't helpful.
Probably not, but why is that so far fetched? They'd just need to be dissolving it with chemicals, backed up by a neural network to identify the sequence (rat's brain, anyone?). That's kind of how smell works in general to begin with.
As for why rats may develop the ability to sequence XX vs XY - if rats with the ability to do so were killed far less than those without, then rats would quickly evolve the ability to do so. This could happen if males were the ones killing rats and not females. Actually, skip the 'probably not' I began with - it's a perfectly likely explanation that may or may not be true based on further study.
Or there could be a signaling molecule specific to sex that directly interacts with some receptive system in the animal. Maybe it's nose? DNA sequencing would be an awfully slow signal given the technology available to the organism...