Can I use a router on a vertical surface?
Routers are very handy tools and can be used for some amazing things but can also be very dangerous if not operated in a manner where you can easily maintain 100% total control over the tool at all times. 

While it may be technically feasible to operate a router on a vertical surface I would be tempted to recommend against it in this case. The reason is that the doors you show will end up being partially open once you try to clamp on the template to one of the doors. This leaves the door in a not so secure and firmly placed position which could lead to disaster (to you and/or the door) should the router grab the material in the cut such as can happen it making a climb cut.

It would be far better to simply remove the screws that hold the doors in place and locate each door in turn to a solid work horizontal work surface. There you can securely clamp the door to the work surface so there is no chance for it to move around during the routing application. In the horizontal work position you also can have both hands on the router to focus the job of moving the router around from a comfortable body position. In the vertical position the cuts most likely are not at an ideal height and you are having to change your body position up or down during the cut whilst at the same time having to control the weight of the router in addition to moving it around.