Spray of 223 or 5.56 will do it.
I don't know if any spray to keep rats away.
Tomcat sells some, but I don't know of it's effectiveness.
Get an exterminator to deal with the rats.
And if you can't do that, get a seaboard container to store the tractor in.
neighbor had a grain drying facility. Learned to shoot by sniping rats with a Pumpmaster 760. So long ago that bb gun had wood stock and fore grip. Or just get a small animal live trap.
I had rats chew into my UTV wires. I repaired them and used "rodent anti-chew deterrent tape" (do an Amazon search). I also put out some poison rat chunks in dog/cat proof boxes. So far, that has worked.