You have to do some maths and some measurements. How reliable is the sun in your area? How big is your LiPo? Will it provide enough energy for a few rainy days? How much current does your system draw when running on LiPo/USB? You can probably influence the latter by intelligently writing your software but expect it in the range of 25mA@5V idle plus whatever the ultrasonic sensor draws.
Otherwise, the system claims that it provides 5V, so it should power your Pico and the ultrasonic senor. But to be honest: I would not expect much for that price. The good thing is: it is not expensive so you can just buy, test and learn.
One thing you also have to think about: the Pico Lipos have a power button directly on the pcb. This is fine while tinkering on your desk, but once you have it in an enclosure or even in an oil tank, you might have problems turning the system on. There are no connectors for a sort of remote power button.
Edit: the HC-SR04 (I assume you are thinking of this sensor) draws 15mA@5V. But you will have a problem with wiring: the sensor needs 5V, so you would connect it to VBUS. But when the solar panel does not provide enough voltage, the system will run from LiPo, which is connected to VSYS and is only 4.2V max (typically 3.6V).
This is absolute overkill. For the sensor, you need two pins, not 40.
Why not just use a Pico-W (or Pico2-W) together with a LiPo-Amigo-Pro? The Pico-W still has 26 pins, so that is plenty even if you want to attach more peripherals.
It is not only about the money. The Amigo Pro is much more flexible. You can attach wires and thus route all functions to a panel when the system is inside a box.