Nagelsmann, whose sacking in March 2023 led to Tuchel's arrival, was tipped to return to Bayern, but has now extended his contract with Germany until 2026
Former Barcelona striker Sandro Ramirez opened the scoring with a breakaway goal in the 32nd minute before Jony added a 90th-minute second for the hosts.
Neymar was shown two yellow cards and dismissed midway through the second half as Barcelona handed control of the title race back to Real Madrid, who are three points ahead with a game in hand.
Los Blancos drew 1-1 with Atletico Madrid in the derby clash earlier on Saturday and a victory at La Rosaleda would have sent Barcelona top on goal difference.