St Mirren progressed to the fifth round of the Scottish Cup with a comfortable 2-0 victory over Brechin City.