In the eighth inning Tuesday night, Jacoby Ellsbury came to bat and popped up to the shortstop.

What can you expect from a $153 million pinch-hitter?

The New York Yankees saw their surprising season of contention come to a close with a 3-0 loss to Houston in the American League wild-card playoff game.

While Red Sox fans usually take solace in a New York defeat, they can hardly be gloating after their team’s second-straight last place finish.

But really, both teams were trying to rebuild on the fly. Does the fact that New York played one more game than Boston this year put the Yankees in better shape next season?

Both teams have rising young players, as well as their issues – did we mention yet that Ellsbury is under contract for five more years (and $111 million)?

The Yankees had home-field advantage in Tuesday’s game, but seemed underdogs from the start, which is strange considering New York’s $218 million payroll. One salary statistic made the rounds: Houston could afford to pay its nine starting players Tuesday a combined $28 million this year, or less than $7 million more than Ellsbury.

But Houston came across as the favorite Tuesday, not only because of Astros lefty Dallas Keuchel but also because of the way New York collapsed at the end – going from a seven-game division lead in late July to 87-75.

“All of a sudden the wheels started coming off over time,” New York General Manager Brian Cashman said after the game.

Maybe the surprise is that the Yankees kept the wheels on for so long.

“When the season started, no one thought we would be here,” Yankees Manager Joe Girardi said.

This was the team with aging players under long-term contracts.

But New York got production from Alex Rodriguez (40), Carlos Beltran, (38), and Mark Teixeira (35). The rest of the roster was not kids, with CC Sabathia (35), Ellsbury and Brett Gardner (both 32) and third baseman Chase Headley and catcher Brian McCann (both 31).

Maybe it was age that caught up with the Yankees. While they finished second in the American League in runs scored; they were fourth after the All-Star break, and 11th in September.

While Rodriguez led the team with 33 home runs, he batted .216 after the All-Star break. Both Teixeira (.255 average, .906 OPS) and Ellsbury (.257/.663) played only 111 games because of injury. Teixeira missed the end of the season and the playoff game, while Ellsbury batted .220 in the second half, and was benched for the one playoff game.

Gardner hit .207 in September, Headley .192, and McCann .177.

Faded down the stretch.

New York Post columnist Joel Sherman used to refer to the “albatross” long-term contracts of Rodriguez, Teixeira and Sabathia. On Wednesday, he wrote of the new “Yankees salary albatross” being Ellsbury, who left the Red Sox after the 2013 season to sign a seven-year, $153 million deal.

New York also will still be paying Rodriguez (two more years, $40 million), Teixeira (one year, $22.5 million), Sabathia (one year at $25 million, with a vesting option for 2017), ace Masahiro Tanaka (five years, $111 million), and McCann, Headley, Gardner and reliever Andrew Miller for three more years.

A lot of commitment for one playoff game over the past three years.

Chuckling, Boston fans? Here are two names to bring silence:

Hanley Ramirez and Pablo Sandoval.

Ramirez, 31, has three more years and $66 million left on his contract, with a vesting option for 2018. Think some of those Yankees faded? Ramirez batted .183 after the All-Star break, with six doubles and no home runs. He has been banished from left field and is a player without a position, unless he learns how to play first base.

Sandoval, 29, has four years and $75 million remaining. After the All-Star break, he hit .210 with a .602 OPS. While he’s played overweight before, age appears to be catching up to him. That may explain why he had the lowest wins above replacement, a measure of a player’s overall value, of all 21 qualifying third basemen in the majors.

Dustin Pedroia, 32, has six years (and $84 million) left on his contract. Pedroia put up some of his best numbers – .291/.797 – but also played just 93 games because of injury. He played only 135 games the year before.

Rick Porcello, 26, signed a four-year, $82.5 million contract extension. He began horribly and finished with a 4.92 ERA. But the ERA was 3.53 in the second half and he might settle in as a No 2 or 3 starter.

Outfielder Rusney Castillo, 28, has five years and $55.5 million left on his deal. He played only 80 major league games (.257/.647) in what was essentially his rookie season.

Both the Yankees and Red Sox are counting on talented young players.

The Yankees feature a slew of young starters, led by Tanaka, 26, and 21-year-old sensation Luis Severino, who was 5-3 with a 2.98 after he was called up.

They also have shortstop Didi Gregorius, 25, who was an upgrade from an end-of-his-career Derek Jeter; first baseman Greg Byrd, 22 (eight home runs in 26 games), and second baseman Rob Refsnyder, 24 (.302/.859 in 42 games).

Boston brought up one pitcher who has proven his worth. Eduardo Rodriguez, 22, was 10-6 with a 3.85 ERA.

Boston features a young, gifted outfield of Mookie Betts, Jackie Bradley Jr. and Castillo, along with shortstop Xander Bogaerts and catcher Blake Swihart.

Bogaerts (.320/.776) and Betts (.291/.820) had breakout seasons and are stars in the making.

Plus, first baseman Travis Shaw hit .279/.822 with 13 home runs (tied for fourth on the team) in 65 games. He is insurance if Ramirez fails at first base or is traded.

In the offseason, New York and Boston will be like everyone else – looking to bolster pitching. Boston is more desperate for an ace, but the Yankees may be joining the Red Sox (and others) in a quest for starter David Price.

Both teams need bullpen help although, again, Boston’s need is greater. The Yankees want to supplement Andrew Miller, Dellin Betances and Justin Wilson. The Red Sox need depth beyond Koji Uehara and Junichi Tazawa.

As for the big contracts both teams have gambled with … maybe Rodriguez and Teixeira have another good season left in them, and Ellsbury can bounce back. Could Ramirez and Sandoval contribute to a contender?

Boston can take heart that it finished with promise – 34-27 since July 28 – while New York has its playoff appearance. But we both know what these teams always aim for:

Championships.