Will 2" x 6" treated lumber warp if used like this?
Treated lumber is more likely to warp due to its high moisture content, and the outcome depends on several factors:


How securely it's mounted - warpage can create strong forces, but they can be resisted in some cases.
How quickly it's allowed to dry - direct sunlight dries the exposed surfaces quickly, exacerbating warpage.
The grain of the board - those with cupped grain are more likely to experience cupped warpage.