Sourabh -- the target SDK is the level at which your app is expected to be tested against or compatible with, it does not specify the version of the SDK that is used for the build. Instead, it affects the behavior of the "compatibility layers" on the device when your app is actually loaded and run on an Android device.
Because the build system is in the cloud, you do not have control over the specific SDK that is used to actually build your app. If you need that level of control you need to use Cordova CLI directly.
My guess is this has something to do with the "diagnostics" plugin you are including. It is likely forcing a specific SDK version number. Try removing it from the project and building again to see if that eliminates the build error.