Before you do it, check the train schedules carefully to make sure it's doable. It's never fun to drag into your hotel very late at night because the train you thought you could catch wasn't running that day.
Pisa is a must see but only for the two hours you describe.
Lucca has a nice wall turned park. The wall isn't medieval looking like San Gimignano, however, it looks more like Ft. McHenry.
The town is very flat. I could see it being good for people who have trouble negotiating hills and a good place to rent a bike. For us it was just okay and we wouldn't build a trip around it.
We were there in October and it was dead (another reason to rent a bike there) while other places had manageable crowds. I can see how in high season Lucca might be a pleasant alternative to drastically crowded alternatives.