I'm not sure I've found stainless brake cable housings. So... the cables may not rust, but the housings may rust if they are steel lined.
Probably somebody has made rust-proof housings that cost 10x the standard cost.
Lined brake and Lined Derailleur housing (different) may be of some help.
Of course, rust in the housings is usually only a big problem in a few conditions such as mixte bikes with a housing that makes a loop downward that could pool water. Or, of course, housing with damaged covering.
I did buy some Chinese imported "stainless" derailleur cables that turned out to be galvanized
There may be MTB cable kits that reduce water and mud penetration into the cable housings.