To avoid isolation, begin to focus on what you share with your coworkers rather than how you are different from them. Race and gender only tell us who we are.
Employees of any organization should not be differentiated on the basis of color or religion. We have many interests, values and priorities which are shared by others. The one that is sitting beside you may be of any color, but she/he is your colleague. You should reach out to everybody and make friendship with them.
Avoid speaking for a particular section
Another way to fight isolation is not to be the spokesperson of your race or gender even when you have every reason to act like one. There is a danger of not treating a minority group in a team or an organization as individuals. They may be labeled as a symbol of their category or class. That is why they should not agree to be experts on issues concerning their race or their ethnic group. You, as one belonging to a minority, should not educate others about your cultural or ethnic heritage.
Professional attitude
Despite your effort to be seen as an individual, if you are discriminated you should avoid addressing the issue with heated emotions. Tackle the issue with professionalism. As a first step towards that goal, you should keep your cool so that emotions settle down. It may take some time before you calm down and recollect how the incident had taken place. Then find out who is the appropriate man to be approached. Talk to a person who is trained to handle such incidents with confidentiality, tact and fairness.
Lack of diversity should not discourage you from joining a company with a small group of workmen. In such a situation, a lone minority member like you may become close to everybody and may not feel lonely at all.