Originally Posted by
corporate-wage-slave
That will be fine, it would not be unusual if there were several people called Mohammed Ali on a BA service. They do need to have different passport numbers though.
In terms of going forward, just get one of this pair to omit their middle name or to abbreviate it down to one letter. There is no requirement to use middle names and in some cases Amadeus can't accept them when they are too long (e.g. Spanish matronymics). They often get messed around the names go via multiple GDS systems.
Just to clarify, the OP stated that neither has a middle name…