Yes and keeping the barn as clean as possible will greatly reduce the rat problem. Also at times treat or grain bags are left open and abandoned and these things can attract rats. A hard container to keep sponges in works as well.
If you put them in a container that the rats cannot get into (such as metal) they won't be able to get to them. That's the most humane and safest way to take care of the problem.
You could get rat poison but you have to be very carful horses and other animals would get a hold of it.