While I don't like getting my railguns 6" away from bad guys in the first place, It happens all the time. The only railguns i can actually keep from dying most of the time are those that are attached to my hammerhead. The reason? They are really fast!
. Broadsides move
at most 6" a turn while still being able to fire their guns. It's ok to lose a few broadsides in actual games because they can usually get their jobs done in the first and second turn due to their extremely long range. However, when your entire army is composed of broadsides, or broadside like models (Slow, powerful, bad at cc, long range, Typical Tau gunline) you can't let the enemy army get close to you at all because your entire army is on the line. Basically, Table them in 2-3 turns or die.
My solution for this in the real game is to have great mobility in order to outrun the enemy, However, I'm assuming the entire table seems like an ocean of models slowly approaching you in an apoc game, so going to the left or right wouldn't exactly solve your problems, it would just run you into new ones. When I looked back at the datasheets that tau have access to I saw the redeployment options and saw a new way to exploit tau's mobility. The redeployment option allows you to hit the enemy where he is weakest every game, And the Models that the datasheets offer are all very quick (Mass Devilfishes, Pirhanas)
Another solution, like I already said, is the close combat wall, but I feel as if people would be able to get around that with things like deep strikes, outflanks, skimmer transports, and any other tricks they can hide up their sleeves. Any of those things would allow the enemy to get close to my broadsides and if they get there safely, kill them all. However, if you deepstrike near, outflank near or charge a skimmer at my squadron of devilfishes, I can just move them backward. ^^