Using "in" as opposed to "on" in that phrase would suggest that whatever you were talking about was serving as a hindrance toward an intended goal.
As an example, let's say you're driving down a road. As you drive, you see an ambulance at the roadside. You would drive past it, and move on.
You saw that ambulance "on the way" to your destination. If the ambulance had been in the middle of the road blocking your path, it would have been "in the way".
However, in your example the object is "difficulty", which we can assume would be a hindrance even if you didn't specify it being "in" the way. For this reason, "on the way" can be used interchangeably with "in the way" if you're talking about "difficulty", "challenges", etc.
To answer your second question, the correct wording is "in the way of".