Government spending and borrowing have defied expectations, resulting in "perilous" public finances and placing pressure on the chancellor to raise taxes or cut spending.