Your suggestion would be foolish.
Rule 11, Section 5, Article 1 in the 2016 NFL Rulebook defines a safety as:
- if the offense commits a foul in its own end zone or;
- when an impetus by a team sends the ball behind its own goal line, and the ball is dead in the end zone in its possession or the ball is out of bounds behind the goal line.
To take your example, let's say Team A does what you suggest. They run backwards for a safety, fulfilling the requirement of "when an impetus by a team sends the ball behind its own goal line, and the ball is dead in the end zone in its possession." This gives Team B 2 points.
Rule 11, Section 5, Article 2 defines what takes place after a safety:
After a safety, the team scored upon (Team A in your example) must put the ball in play by a
free kick (punt, dropkick, or placekick) from its 20-yard line. An
artificial or manufactured tee cannot be used. See 6-1-1-b and 6-1-3.
Thus, Team A, now 3 points behind, is free kicking the ball to Team B. Team B gains possession the ball with under 2 minutes remaining. As they are up by 3, Team B can proceed to attempt to run the clock out and win the game.