It's a 20 minute bus ride to the station (Bahnhof) in Freising. After that you can walk (I believe there is also a bus) to Weihenstephen, a monastery with the worlds oldest brewery and a nice beer garten.
Other than that, going into town will take 40 minutes each way to Marienplatz. If you have luggage checked through to Budapest, getting back an hour before plane time should be sufficient. The dwell time in Munich still won't be very long, but you might have two hours in Marienplatz.
There are 6 S-Bahn/hour into Marienplatz, S1 from the west via the Hbf, S8 from the east via Ostbahnhof. Whichever train is leaving the airport next will get you to Marienplatz first. But be careful on returning. The S1 and S8 leave for the airport from different levels at Marienplatz. Wrong level and you will end up somewhere in the suburbs, far from the airport.