I do not know, your code was on my side compiled successfully - Keil Studio Cloud, MbedOS 5.15.7.

I just recommend to place the pinmaps before Serial objects declaration and you also have to fill the rest UARTs because you have two more in your code.
BR, Jan