Rangers moved into second place in the Scottish Championship table with a comfortable 2-1 win over champions Hearts.