You can take a flight to Cusco, then train to Machu Picchu, & return back to Lima. Don't know about going to the Galapagos -- many do it, though. We did not. You would not go from Cusco at any rate, but from Lima. Agree that www.andeantravelweb.com has much good information for you to begin planning your trip.
If you don't want to plan it all yourself, there are many agencies often recommended on this forum:
Numerous companies offer Machu Picchu and Galapagos combination tours (try Google...). When comparing, make sure you check what is included in the price (ex: flights, entrance fees), and what type of hotels/boats are included.
Also, are you planning on doing this trip during a layover??? If so, I hate to break it to you, but not going to happen. You need about a week.
Thank you everyone who responded to my post. We have extended our layover to 5 days and will now have enough time for travel .I am sorry to learn about the rainy season but this is the only time we can travel.( Feb)Edited: 9:11 am, October 24, 2012
While the chances of getting rain are increased during the rainy season you can get rain at Machu Picchu even during the dry season, just bring Umbrellas and/or ponchos.
-:- Message from TripAdvisor staff -:-
This topic has been closed to new posts due to inactivity. We hope you'll join the conversation by posting to an open topic or starting a new one.
To review the TripAdvisor Forums Posting Guidelines, please follow this link: http://www.tripadvisor.com/pages/forums_posting_guidelines.html
We remove posts that do not follow our posting guidelines, and we reserve the right to remove any post for any reason.