Thanks for the report. There is no namespace in candid imports, which will certainly cause problems with multiple imports. I will file a bug: https://github.com/dfinity/motoko/issues/3103.
The current workaround is indeed to write custom type definitions to avoid the collision. A slightly more automatic approach is to use didc to generate the type bindings with didc bind a.did -t mo. Then you can import A "./a"; import B "./b" in Motoko and use A.Result_2 and B.Result_2 to avoid name collisions.