if you have rust on the tray this can become a mini-project.
1) Neutralize the battery acid 1st as noted above with Baking Soda & water.
2) Then neutralize the rust. This uses another special acid - Phosphoric Acid to neutralize the iron oxide. Ospho is great. POR15 - Metal Prep also works great. I sort of like Metal prep because it also has some Zinc Phosphate in it to help protect against flash rusting (yellow surface rust). Either product turns the rust to a black inert state.
3) Now neutralize the Ospho / Metal Prep with water a baking soda. Dry quickly with compressed air or heat gun and dry rags to prevent the yellow flash rust.
4) If the battery tray rust is heavy, I'd wire wheel it, and then repeat steps #2 & #3. Sometimes it takes a few cycles of #2, #3, #4 to get all the rust gone and/or turned to a nice black state that won't dig out with the wire wheel.
5) Paint with your preferred product (prime 1st).
I know that is a lot of extra work but short of replacing the tray, that is how I'd deal with any rust in the tray after the battery acid is cleaned up.