I'm afraid the question is too broad for a definitive answer. All other things being equal, the greater sectional density of the .40 should make it the better penetrator, but all other things are not necessarily equal. Other variables may have more effect on hard barrier penetration than caliber, notably bullet construction.
Throughout GT, you'll find links to various barrier tests with the assorted police handgun cartridges, often using the FBI protocols. Bonded bullets tend to do particularly well.
Different tests produce different results. An instructor for the Florida Highway Patrol told me that one reason FHP just adopted the Glock 37 was that their testing showed a 200 grain .45 GAP load gave the best tactical vehicle penetration of all the .40s and .45s they tested. Go figure.
Sorry I couldn't nail it down more tightly for you,