In Poland overtaking on the left is legal on motorways and any other roads with lanes in both directions separated. It is also legal on roads with three lanes in each direction outside cities and two lanes within city limit.
E.g. (page in polish, but has pictures) http://www.strefakulturalnejjazdy.pl/2013/06/czy-mozna-wyprzedzac-z-prawej-strony.html
If you were in Romania, you wouldn’t have broken any laws.
The Romanian law makes a clear difference between overtaking and passing.
In Romania, you can overtake on the left lane only, but you can pass on all lanes.
Overtaking (is the same as in US and all the countries of the EU): signal left, change lane, move in front.
Passing (as being described by the Romanian legislation): you cruise on the motorway and you encounter a vehicle on your left or right lane moving slower than you and you simply keep your lane and pass him.
The difference between passing and overtaking is that when you overtake you move from one lane to another and the distance to the vehicle in front of you is smaller than 100m. When you change lanes and the distance between cars is bigger than 100m you legally execute the change lane maneuver. After you execute a change lane maneuver, you encounter a vehicle moving slower than you on your left or right lane and you cruise along him, you would be executing the passing maneuver, NOT overtaking.
Long story short, if the situation you described would have happened in Romania, you would have legally passed him on the right lane.
I have discovered that most of EU countries do not make the difference between overtaking and passing.
I added this as an answer because it was too long for a comment.
You are right about the overtaking rules. You can only overtake on the left side of the other driver. But, there is another rule, you should occupy the right-most lane (except in the UK of course, there it is the other way around).
There are a few exceptions
In the specific situation you are referring to, it does depend on what is happening in front of you. In case of normal traffic, you were not allowed to overtake him, even though he was braking. Maybe the speed limit changed at that location, and was that the reason for braking?
Overtaking on the right is especially dangerous, as drivers in Europe do not expect this. Even tough someone is not obeying the ‘keep right’ rule (and is phoning). So, what you should have done, officially, is brake, change two lanes to the left, then overtake, and change two lanes back again. In practice, most Europeans would do what you did, and give the other driver the angry face (if he really had no reason to brake).
Credit:stackoverflow.com‘