The federal government’s budget deficit widened to $311 billion in February from $235 billion in the same month last year, the Treasury Department reported Wednesday.