I believe this move was necessitated by Russia's realization that the Syrian Regime, supported by Iran and Hezbollah was no longer capable of sustaining itself and if left alone would fall. Accepting a moral defeat is a difficult thing for Putin and the Iranian leadership especially these days.
At the same time, having power on the ground in Syria and taking charge of loyal forces on the ground would allow Russia to position itself as the primary international player in Syria in any settlement discussion and the key player that can provide security to any new government.
What are the benefits to Russia and Iran? Is it worth the cost and risk?
I don't think the benefits are worth the cost and risks to both nations but may be important to the corresponding political leaderships. Yes it is useful for Russia to maintain influence in Middle East Affairs and to have a base on the Mediterranean, and it is useful for Iran to have an expanding influence in its neighborhood and a link to the Mediterranean & Hezbollah via southern Iraq & Syria.
However, at this time when both nations are much challenged economically and politically, adding further burden for peripheral stages is not intelligent. But both political systems need to keep their voters busy with regional political & military challenges, to take the minds of their voters away from the lousy local economy. Otherwise how can the conservative Iranian political elite explain why sanctions were lifted but the economy is still getting worse? What explanation can Putin give other than Russian National Interests should take priority over the economy?
I don't believe Russia will execute a land offense with Russian or Iranian troops that is not their primary objective. Their primary objective is to keep their local voters support, keep minds off the local economy and avoid a moral defeat in Syria, and it would be really great if they can end it in a way that they can claim victory.
It is worthwhile remembering some lessons from recent history, in Iraq the easiest move for the USA was to conquer the country. However to keep hold of it, the USA moved and located over 250,000 troops and a much bigger military machine behind them and spent over a trillion dollars and still pulled out after three years.
The Iranians and Russians cannot take over Syria and keep it with 30/40 airplanes and 30,000 Iranian & Hezbollah boots on the ground. Not to mention the fact that the weak economies of both nations will not be able to absorb a fraction of what the USA paid in Iraq.
The best possible scenario for Russia and Iran today, would be that they show great force and determination and then manages to get Europe, the USA, Turkey, Saudi and the Syrian opposition on the table to negotiate a settlement which most likely will dispose of Al Assad but guarantee that the new Syria has a close working relationship with Russia.
The nightmare scenario for Russia would be that Europe/USA/Turkey and Saudi decide that there is no hurry, let Russia fight ISIS and the other opposition groups. Let them sink in the Syrian swamp and suffer like the USA did in Iraq (does that not remind you of the USA & Vietnam then Russia & Afghanistan??) and sometime in the future, when the Russians are tired and looking for an exit, the USA and Allies can extract much better terms from them in any settlement, and in the meantime consume them from starting problems in other places. That is, unless the GCC wants a settlement in Yemen, the EU needing a solution to the refugee problem and Turkey finding regional peace and reduced tension economically useful, which would play in Russia's favor, otherwise see you in three years...