1. His failure is mainly due to his carelessness.

2. His failure is mainly because of his carelessness.

3. His failure is mainly owing to his carelessness.

---------------------
Are they all the same and grammatical?

All mean the same thing. Sentence 2 has the best phrasing of all.

Yes, all the sentences you provided are grammatically correct and convey the same meaning. They all express that the main reason for his failure is his carelessness. However, each sentence uses a different phrase to express causality:

1. "Due to" implies a direct cause-and-effect relationship between his failure and his carelessness.
2. "Because of" also indicates causality, but in a slightly less formal manner.
3. "Owing to" is a more formal and less common phrase, but it still denotes causality.

Overall, the sentences are interchangeable in terms of meaning, but some phrases may be more appropriate depending on the context or desired level of formality.