The Republican-dominated Kansas Legislature, confronted on Wednesday by both a budget crisis and a governor resolute on preserving his record on tax policy, handed a narrow victory to Gov. Sam Brownback, whose veto of a plan to raise more than $1 billion over two years barely survived an override attempt.