I found this article on this topic from a lawfirm specializing in entertainment law interesting:
https://rodriqueslaw.com/blog/how-use-brands-and-products-fi...
It references some of the existing caselaw. My reading suggests Apple would be very unlikely to succeed in court if they legally challenged a filmmaker for simply giving an iPhone to a villainous character.