Displaying Elements in Mobile only

I have just tested this and it works fine with a button element and a text element.
Make sure that you are testing it on a live site and not through preview only,

In this tutorial here about the same thing it uses text elements and it all works as stated.
https://support.wix.com/en/article/corvid-writing-code-that-only-runs-on-mobile-devices

Plus, you will note that on the above link it does actually tell you to test on a live published site too.

Testing
If you want to test how your code works on mobile devices, you’ll need to publish your site and view the published version on a mobile device or in a mobile device emulator.

Warning:
If you preview your site, it will always behave as if it is being viewed on a desktop device, even if you preview from the mobile editor.

To test your site on a desktop machine as if it is being viewed on a mobile device:

  1. Publish your site.

  2. View the published site.

  3. Open your browser’s developer tools .

  4. Use your browser’s developer tools to emulate a mobile device. (This is usually called something like Toggle device toolbar or Responsive Design Mode and turned on using an icon.

  5. Refresh the page so your site now loads as if it were on a mobile device.

So make sure that you are following the tutorial correctly and have the elements on the desktop editor set to be hidden on load etc.

Using this code below I had no issues with it, even in the preview mode only.

import wixWindow from 'wix-window';

$w.onReady(function () {
if(wixWindow.formFactor === "Mobile"){
$w("#button1").show();
$w("#text1").show();
}
});

Wix Desktop Editor

Wix Mobile Editor

Testing Preview.
Desktop Preview Empty

Testing Preview.
Mobile Preview Showing