The difference is in the person who draws the conclusion:

> Der Text war ihm zu schwer

In this case the judgement is drawn by the person themselves. They state that it is too difficult and we just report their statement about the task.

> Der Text war für ihn zu schwer

Here it is me (or the narrator) who thinks that it was too difficult for the person we talk about. It does not imply self-reflection of the person being talked about or that they would agree.

This said, when I talk about some task, there is no (big) difference whether *I* say "Der Text war mir zu schwer" or "Der Text war zu schwer für mich". If I had to make a distinction here, I'd use the first ("war mir zu schwer") when it is a self-imposed task I want to do from my own motivation and "zu schwer für mich" when it is a task which someone else asked me to do - but I'd not bet no money on this distinction being made at all times.