Answer depends on how fast and conveniently you want to travel.
But first, your travel date of Dec 9 just happens to be the date of the seasonal schedule change, so you can't buy tickets for a while until the schedule is finalized and published, maybe in September or October. Same for the Nuremberg-Munich trip.
Passau to Munich can be done with a direct ICE train that goes every 2 hours (at least at present) and takes 1 hour and 53 minutes. You can buy Sparpreis tickets many months in advance which can be as low as 19.90 EUR per person. They are train specific, meaning you must travel on the exact train you booked on that day, like an airline ticket. You can get a refund up to the day before by paying a 19 EUR fee. You buy the tickets on-line and print at home, or load them on your smart phone with the DB app.
Now if you can take a slower train, with a change or two along the way, you can use regional trains to get to Nuremberg. Dec 9 is a Sunday, so there is no time restriction and you can use a Bayern Ticket for 25 EUR for the 1st person and 6 EUR for each additional person up to 5 people traveling together. It will take 3 to 4 hours because the train make a lot of stops, plus train changes. But you are not obligated to any itinerary. As long as you stick to regional trains, you can go anywhere in Bavaria. So if you decided to say, stop in Regensburg for a few hours, you can do it. Added bonus, when you get to Nuremberg, it is valid on the U-Bahn, trams, and city buses for the rest of the day.
You buy these tickets out of a vending machine at the station. If you go to the ticket window, it costs 2 EUR more. Write all the names of the travelers on the back of the ticket in ink.
Same situation for Nuremberg to Munich, choice of ICE in just over an hour, or regional train in about 2 or 3 hours. Dec 13 is a Thursday, so you must travel after 9 am with a Bayern Ticket.