Ms Rack for batteries
It will sag. This is known as "deflection", and is known for various materials and cross-sections, including your steel pipes.

https://www.engineering.com/calculators/beams.htm

Scroll down to "Hollow rectangular beams" and enter your numbers. Unfortunately, this calculator is in inches, but it's easy enough to convert.

Your 300kg mass would cause a deflection of 17.25" or 438mm, but that is based on a single 300kg mass placed on a single tube. In reality, your load will be spread out more, right? If it is evenly spread over all 4 of your pipes, then one pipe has to carry 300kg/4 = 75kg, which would result in 1/4 of that deflection, or about  4.3" or 110mm.

These are just estimates, as the specific material and how you load your shelf will make a difference.

To improve on (reduce) the deflection, you have the following basic options:


Reduce the total load.
Add more tubes. This would distribute the load more. Divide your total load by the number of pipes for an "ideal" estimate assuming perfect distribution, as I did above.
Stronger material (thicker tubes).
Shorter span. If you can move your end supports in towards the center, or add a center support, your effective span length is reduced.