If one has a slight urge to defecate before davening is he allowed to hold it in if he wants to join a certain miyan especially for Shmone Esrei and Kriyas Hatora?
No, he should not join that minyan, and even if he has to join that minyan, it is better for him to miss half of it, then to daven in a way that Hashem doesn’t want us to daven. Davening when we have to use the bathroom is like visiting the king holding the kitchen garbage bag in your hand. It is an insult to Hashem, and therefore we have to clean ourselves before our sacred meeting with Hashem. This is why we check ourselves before starting to daven if we need the bathroom or not.
On the other hand, if one checked himself, and they don’t need the bathroom, they can daven without thinking about it at all. But if one has an urge before davening it can not be held in. it is better not to daven at all.
It is also important to note that many times a person might think that they need the bathroom when they don’t. If you will get busy doing something else and the feeling of needing the bathroom will disappear, that is an indication that what you are feeling is not a need to use the bathroom, but something else. This idea is very practical, and comes to use often.
Orach Chaim 92-1