It’s an ongoing process. When Tywin marches across the Riverlands, “they trotted past blackened fields and burned holdfasts, down to the Riverlands and the Green Fork of the Trident…Ser Gregor burnt out the Pipers and the Brackens,” and Tywin is already sending out “foraging parties.” That’s well before Tywin gives the order to burn the Riverlands from the “ from the Gods Eye to the Red Fork.” In the meantime, the Riverlords have been “burning their own crops to try and starve us,” as they did back in the Dance.
So no, marching on Harrenhal is not a miracle solution. If Robb wants to cut Tywin off from resupply from the Crownlands, he’s got to completely circumvallate the biggest castle in Westeros, which means stretching out his army to the point where Tywin could pull a Frederick the Great on him. Moreover, if Robb does this, the entire Riverlands – which he would be relying on for supply – is open to Ser Stafford Lannister.
Moreover, Robb’s supply situation is automatically worse than Tywin, because he’d be trying to support twice as many men as Tywin is.