First, some fairly specific partial answers can be given. As Bob Baerker notes, compounding ensures that getting into the higher-return fund is better if the time horizon is long enough. In practice, if you will remain invested for decades, you should switch even for a very small increase in return.
Moreover, regardless of horizon, one scenario in which you should be sure to switch is if the current return r, new return R, and tax rate m satisfy R > r/(1 - m). That is, you should switch if this is true (otherwise, you might or might not want to). For example, if you have a standard long-term tax rate m = 15%, you should switch from r = 3.5% in any case where R > 4.12%. To see this, note that at worst, if you have zero tax basis in the current fund, your capital shrinks by a factor (1 - m) when you sell and pay tax. If R > r/(1 - m), then you come out ahead right away (e.g., in the first year), as your dollar return immediately increases. And compounding will only, um, compound this effect over time.
The general switching criterion for horizon t, expressed in terms of simpler pretax quantities via an algebraic equivalence, is
P*e^(R*t) - m*G*(e^(R*t) - 1) > P*e^(r*t),
where P is the initial capital and G is the initial unrealized gain (i.e., the tax basis is P - G). This has a simple interpretation: The right-hand side (not switching) is the future value of P at return r. The left-hand side (switching) is the future value of P at return R, minus the cost of having to pay the tax m*G now instead of later.
Note: I am assuming that the tax rate is constant over time. Also, I am treating the "expected" returns as if they are guaranteed, and neglecting volatility and risk tolerance.