How long can sperm cells remain viable in the mouth?
You have asked for specific information here. As per my awareness, there are no studies available to help us understand viabiliity of sperm within the oral environment.
But oral and salivary secretions contain enzymes that can digest sperms rendering it ineffective. The digestion process starts within minutes of contact with salivary secretions. So I would say the sperm may remain viable for only minutes.
I don't think they would remain viable overnight. They would be ineffective long before brushing.
Hope this answered your question. Let me know if you need clarifications.
Still the risks are very, very low.
The risk of pregnancy is still very, very low. For all practical purposes pregnancy chances is zero.
Sperms are made up of organic content. They react to salivary secretions as well as contents of tooth paste making them less viable. Even if they survived, they are too low to cause pregnancy.
If I have to elaborate further, only when sperm counts are in millions with active motility, they are able to swim across cervix and uterine cavity to fertilize an egg. Very meager sperms that are damaged cannot achieve this process of fertilization even if introduced directly or through unprotected sexual intercourse. You should therefore be assured that any survived sperms from the mouth and finger practically don't lead to pregnancy.
Stay assured and allay all fears of pregnancy.
Hope this helps.