I would shop the IS, but not the Acura TL. The Lexus has RWD or AWD. In comparision to the G35, the Lexus will have less power, but I'm sure the interior will put the G35 to shame. Also, the Lexus reputation still rises far above the Infiniti's.
For me, the shopping list in the $40K-on-the-mark would be:
BMW 323/325. I'd look at both carefully to see how to get the best value for the car I wanted.
Lexus IS250. RWD or AWD. Hopefully an AWD version won't cost an arm and a leg. Lexus. Oddball IS300-ricer styling gone. Hhhmmm.
Infiniti G35. RWD or AWD. Big price jump for AWD. Great driveline, lots of features, still room to improve fit and finish, but pricing is very agressive.
Mercedes C-Class. Probably still gun-shy on quality, but I'd look anyway for the heck of it. Massive price jumps with options or AWD.
Subaru (yes, Subaru!) Legacy wagon. Lots of luxury-type goodies, lots of power (GT models), superb AWD and wagon utility.