Staked and delegated both assume the same staked status of the SYS token in this case. Staked assumes that you reserve the ability to vote on producers. Delegated assumes that you elect what is known as a "proxy" to vote on your behalf. This logic can be seen in the eosio.system.hpp
/** * Total vote weight delegated to this voter. */
double proxied_vote_weight= 0; /// the total vote weight delegated to this
voter as a proxy bool is_proxy = 0; /// whether the voter is a proxy for others
https://github.com/EOSIO/eos/blob/master/contracts/eosio.system/eosio.system.hpp#L99
Also, here is the cleos command and positional arguments for the system voteproducer proxy command.
cleos system voteproducer proxy voter proxy
Positional Arguments
voter TEXT - The voting account
proxy TEXT - The proxy account
https://developers.eos.io/eosio-cleos/reference#cleos-system-voteproducer-proxy
As for unstaking, I've found the cleos command for that in the developer's documentation as well:
system undelegatebw
Undelegate bandwidth
Positional Arguments
from TEXT - The account undelegating bandwidth
receiver TEXT - The account to undelegate bandwidth from
unstake_net_quantity TEXT - The amount of EOS to undelegate for network bandwidth
unstake_cpu_quantity TEXT - The amount of EOS to undelegate for CPU bandwidth
So the command may look something like:
cleos system undelegatebw FROM RECEIVER unstake_net_quantity unstake_cpu_quantity