The Factors
The real question to ultimately answer is: Which choice gives the 49ers the best chance to win? Many people say the game isn't played by math, but by players which is of course true. However, if coaches can accurately estimate the chances of success in given situations, it would give them better data with which to make decisions.
Since the game is near the end, we only really have to analyze a few factors: 1) the chance of making the 20 yard field goal try, 2) the chance of making the 3rd and 1 attempt, and 3) the chance of winning the game, if the game goes to overtime.