Roy's Up-B is only invincible if he starts it on the ground. Since he falls a lot faster than Marth, this means you can't jab lock him. Jab jab grab is the way to go against him, or just initiate a combo with U-tilt or something else.
Your goal against him is to push him offstage and keep doing that through the match until he's at KO percent. Fox can't really go offstage and edgeguard him, and challenging his up-B even if you're playing as someone else is very risky anyways since the hitboxes are really good. However, Roy's recovery is very limited in terms of distance and flexibility, meaning you have several ways of reading how he plans to land onstage or how he'll play to get up from the ledge.