Even at a rib. there is no more than 1/8" of aluminum. Any longer screw is just going to penetrate air. As long as the maximum diameter of the screw threads fully engage the roof, there is no need for longer screws. I would probably choose 3/8" or 1/2" screws depending on the bracket thickness.
I'm a belt and suspender guy and would probably put a dab of sealer on the screw heads. On the roof of my trailer, that's what the factory did.
John W. Irwin
2005 Classic 28 "Sabre-Dog III"
2013 Silverado 2500HD Duramax/Allison LTZ
WBCCI #9632, TAC TX-10