Honestly, the backrest itself is not the main reason a bench rusts. Rust is mostly about the material, the coating quality, and how well water drains off the frame. That said, benches with backs do tend to have more welds, bolt holes, and joints where the back meets the seat. These little crevices can trap moisture, and if the paint or powder coating is scratched or thin in those spots, rust will show up faster there.
Slatted benches often get a bit of a free pass because the gaps between slats let water run straight through and allow air to dry the surface quickly. But a slatted bench still has a metal frame underneath, and if the coating fails, that frame will rust too. In my experience, a well-made bench with a back and a good galvanized or powder-coated finish can easily outlast a cheap slatted bench.
So if you are choosing between them, do not worry too much about the back. Instead, check for galvanized steel, thick powder coating, stainless steel hardware, and remember to touch up any scratches before rust gets a foothold.