One is fully Semitic while the other is a hybrid of Semite and Hamite. Not quite the same race.
It would help to clarify “any definition”, especially if one is really that sure of it. Hagar was an Egyptian, and hence a Hamite. Ishmael also took Egyptian wives.
In actuality, they are both the same race, and they are both the same race as white Europeans, except perhaps for those Arabs who have some African blood in them, and those would be a mixture. Yemenis, for example. The idea of race is a fairly recent one, and it has always consisted of White, Asian, African or Negroid, Native American and Polynesian. There is no “semitic” race, and the ham and hagar stuff is if you take biblical genealogy literally. If you do, even then they are the same “race”, and a closely related tribe within that race.
Depends on who Ismael married. If he married a Semite, his kids would be 3/4 Semitic, if he married a Hamite, they’d be 3/4 Hamitic, and who knows what other peoples he might have come into contact with.