Answer: The Martin B-26 Marauder and the Douglas A-26 Invader (sometime Douglas B-26 Invader) are two completely different designs.
It's a good example of why the designation system is just a bad idea. As for 'attack bombers'.
Interesting question.
Most systems recognise a design authority (usually the design and manufacturing company) and they allocate a design designation to the type. (So they were Grumman J2F Ducks even if built by Columbia.) Sometimes an aircraft gets a name. de Havilland is the design authority for the Mosquito (they are all de Havilland DH98 Mosquitos, even if built by Airspeed) DH98 is de Havillands design number for the type. The Air Ministry called different versions FB, B, NF and F, and then a number depending whither they were fight bombers, bombers, night fighters or fighters respectively, and gave them a number for the version as well. You could use it for different jobs, but the name and number stayed the same and described that version - no other.
O2SU or B-26 are Government allocated designations based on task, not type, and as a result identical aircraft (such as the Goose) can get a plethora of different, complex and confusing designations simply by being used by the Coast Guard, or Marines.
Or in short, chose a system, keep it simple, stick to it. Choose a different name or a number for a thing and stick to it.
By not doing so, the US military were able to fudge purchases of new types under old names. Personally I think it all went wrong at the Nancy Boat stage. The insitance on using jawbreaking designation systems when throughout people are happier with names (hence the conversion of designations to pseudo-names - All Three Dead - A3D, Slow But Deadly - SBD) over accepting a name works is IMHO, silly. Short designations have merit, but A4 and F4 can be confused in radio transmission, mistyping and so forth, a Phantom and a Skyhawk - not.
One specific footnote is that the Martin B-26 Marauder had been retired by the time the Douglas A-26 Invader was re-designated B-26. So
at the time in W.W.II B-26 meant Marauder, and after the war B-26 meant Invader. (And you'll note it's easier to use the
name throughout to mean one or the other rather than the designation .

)
Rant over.