The Maharal (Gur Aryeh ibid) explains that the Gemara which says that a person will surely die in a pit full of snakes and scorpions is only when it is full of snakes and scorpions, but this pit just had a few.
The Ohr HaChaim explains that the brothers felt Yosef was deserving of death because he had testified falsely about them to their father in matters involving a death penalty to a Ben Noach (Ohr HaChaim to 37:20, s.v. ואם תאמר). The brothers intended to prove by killing him that his dreams were false and he made things up at will (Ohr HaChaim ibid s.v. ונראה). Reuvein saved him from them in that he saved Yosef from the hands of those with free will, as one with free will can kill someone even if he does not deserve to die, as opposed to dangerous animals which will only kill someone if they deserve to die. Thus, the brothers knew there were snakes and scorpions, and this would be the test of if he really deserved to die (Ohr HaChaim 37:21 s.v. ויצילהו). (Reuvein himself did not plan on Yosef dying there, but that he would survive the pit and Reuvein could take him out and save him (Ohr HaChaim ibid s.v. לא).)
The Kli Yakar (to 37:24) says that they specifically wanted to cast him to the snakes, as they considered him to be a slanderer, and a slanderer is sentenced to be punished by snakes, as we find in Bamidbar 21:5 and 6, that they spoke badly about Hashem and Moshe and Hashem sent snakes against them (see Rashi there).
The Nefesh HaChaim is cited (Yeshurun Vol. 6) as saying that Reuvein was saving Yosef from being sent out of Eretz Yisrael, and it is better for a person to be in the Land of Israel surrounded by snakes and scorpions than to be sent out of Israel. In that respect, even though they were aware of the snakes, he was saving him.
The Ramban writes that the brothers must not have known about the snakes and scorpions, because had they seen such a miraculous salvation, they would surely have desisted from their plotting against Yosef. Rather, either the pit was too deep or the scorpions were in the crevices around the sides.
The Torah Temimah explains (h/t Matt) that they did not know that there were snakes and scorpions in the pit, because it was very deep. For this reason the Gemara in Shabbos 22a juxtaposes the halacha that Chanuka candles placed at a height above 20 cubits do not fulfill the mitzvah because they will not be seen with the account that the pit had snakes and scorpions in it to hint that the pit was 20 cubits deep, and they could not see to the bottom of it. So they did not know about the snakes and scorpions.