Mattel holds the global rights to the Thomas & Friends franchise, having acquired its owner, HIT Entertainment, in 2016. As the owner and a leader in the children’s entertainment space, Mattel develops and licenses the Thomas & Friends brand across various products, media, and experiences, including toys, television shows, books, and partnerships with companies.
Look at the discreet Mattel logo on the Takara Tomy boxes…

I think they pay a license fee for everything related to the Thomas & Friends franchise.