Have a look to http://docs.platformio.org/en/latest/frameworks/mbed.html#configuration
When you create and build a mbed project, PIO will install mbed-os (not always the last release), but there is some difference to online compiler. You need to set the configuration items (see link to docs) manually, so if you need RTOS (or another part of mbed-os like network) you must add
build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
to the platformio.ini file. The reason is to get more backward compatibility to mbed2 which not
always use RTOS. mbed-os5 is meanwhile a memory killer because the code will blown up unnecessary.