To upgrade Lumen, you need to follow the Laravel upgrade guides when changing between versions.
https://lumen.laravel.com/docs/5.4/upgrade
You will need to make sure you run through the upgrade to 5.3 and then 5.4 as Lumen uses Laravel components.
https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0 And https://laravel.com/docs/5.4/upgrade#upgrade-5.4.0
There are a lot of breaking changes between versions.
There are several changes to routing listed on these upgrade guides. I can't see this listed but the folder structure between 5.2 and 5.3 has changed, routes are now in the routes folder, under different files web.php and api.php
https://mattstauffer.com/blog/routing-changes-in-laravel-5-3/
Hopefully moving your routes into the appropriate file might help?