The key to a mortise and tennon joint is the glue surface. Often, in a manufacturing environment, when the joint is assembled, they will shoot a nail into to hold the joint until the glue dries instead of putting it into a clamp and waiting for it to dry. This speeds up production and takes up less space. There is nothing wrong with that method, but it means the nails really don't do much except get in your way taking it apart.
You can try forcing some glue, like the type you described, into the joint and see if that holds. You can even get glue injection syringes from most woodworking stores.
Ideally, you want to get a good tight glue joint, preferably clamped under pressure. The joints on a chair tend to flex over the years and this causes them to compress and wear and become loose. If you really want to get these back together tight, you will want to carefully remove the nails and pull the joints apart. Scrape off any roughness and take them down to bare wood but be careful not to take off any excess material that will make them more loose than they already are. If they are pretty tight, a filler glue will do the trick. If they wiggle a lot, you may need to insert a thin piece of wood to fill the gaps, like a slice of veneer and clamp the joint. Be sure to apply glue to all surfaces. If you have to lightly tap it with a hammer to get the joint tightly together, you are on the right track. You can also put a small wedge into the back of the tennon to force it to expand and apply pressure to the mortise, but you have to be careful not to completely crack the wood beyond the tennon.