The win avoided a nasty trip to Brisbane for the Tigers and came against a Sharks side desperate to celebrate inspirational captain Paul Gallen's 200th game with an end to their seven-match losing streak.
The earlier victory for the Warriors over North Queensland earned the Auckland side sixth place and consigned the Cowboys to seventh.
If the standings remain the same after Sunday's games, Melbourne will host Newcastle, Manly will play the Cowboys and Brisbane will take on the Warriors.
As well as Farah, Mitch Brown, Tim Moltzen and Lote Tuqiri grabbed tries for the Tigers with Benji Marshall booting three from six.
For the Sharks, Williams (two), Stewart Mills and Jeremy Smith bagged four-pointers, while Williams kicked three from four.
It looked ominous for the Sharks when two tries in the opening nine minutes had the Tigers up 8-0 but the home side stuck with Tim Sheens' men and limited them to a 20-12 halftime lead.
Sheens would have been ropeable when Gallen sent Smith over three minutes after the break to narrow the gap to just two points.
The Tigers made it 26-18 went Farah scored his second after a neat ball from Gareth Ellis in the 60th minute before Williams set up a grandstand finish.
A late flurry from the Sharks came to nothing before Farah celebrated by slamming the ball down after notching his third.
WESTS TIGERS 30 (R Farah 3 M Brown T Moltzen L Tuqiri tries B Marshall 3 goals) bt CRONULLA 22 (J Williams 2 S Mills J Smith tries J Williams 3 goals) at Toyota Stadium. Referee: Gerard Sutton, Ben Cummins. Crowd: 16,879.
- AAP