In both economic and evolutionary theories of games, two general classes of evolution can be identified: dynamics based on myopic optimization and dynamics based on imitations or replications. The collective behavior of structured populations governed by these dynamics can vary significantly. Particularly in social dilemmas, myopic optimizations typically lead to Nash equilibrium payoffs that are well below the optimum, e.g., the tragedy of the commons, whereas imitations can hinder equilibration while allowing higher cooperation levels and payoffs. Motivated by economic and behavioral studies, we investigate how the benefits of the two dynamics can be combined in an intuitive decision rule, rational imitation, that is to mimic successful others only if it earns you a higher payoff. In contrast to purely rational (best-response) or purely imitative decision rules, the combination in rational imitation dynamics both guarantees finite time convergence to an imitation equilibrium profile on arbitrarily networks and can facilitate high levels of cooperation for small public goods multipliers.