Adv/Dis..
-400 has about 140 odd more seats in a 3 class config
-400 can carry more cargo
340 is a more fuel efficient $/seat/km
340 is cheap cheap
340 has commonality with other in the stable 330/320
340 has a teensy weensy more range
340 is easier to fly ( the lure gently floats down and touches the water
)
"Why do some airlines operate both types and on the same route?"
Flexibility- high season low season... because they dont have spare a/c laying around and do the best with what they have... satisfy known demand... freight considerations... etc etc. There are lots of reasons.: